diff options
author | rowanbeentje <rowan@beent.je> | 2012-03-24 12:47:23 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2012-03-24 12:47:23 +0000 |
commit | 21df6e7616419aa87513d61d1721394a7da9e16a (patch) | |
tree | dd8494d81026dabf9f976e27def63398dce18653 /Source/SPDataImport.m | |
parent | 760c9b1c387ab827839b77db259537b97a1a8522 (diff) | |
download | sequelpro-21df6e7616419aa87513d61d1721394a7da9e16a.tar.gz sequelpro-21df6e7616419aa87513d61d1721394a7da9e16a.tar.bz2 sequelpro-21df6e7616419aa87513d61d1721394a7da9e16a.zip |
- Fix an exception when attempting to preserve the selection in a table with a primary key with multiple columns of which the first of which is a blob or binary type
- Clean up NSNull comparisons and add comments
- Clear the selection when filtering a table, allowing reselection to look a little more consistent
Diffstat (limited to 'Source/SPDataImport.m')
-rw-r--r-- | Source/SPDataImport.m | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/SPDataImport.m b/Source/SPDataImport.m index 58d132ce..7272948b 100644 --- a/Source/SPDataImport.m +++ b/Source/SPDataImport.m @@ -1394,7 +1394,7 @@ NSInteger colIndex = [[globalVar substringWithRange:[globalVar rangeOfRegex:re capture:1L]] integerValue]; if (colIndex > 0 && colIndex <= (NSInteger)[csvRowArray count]) { id colStr = NSArrayObjectAtIndex(csvRowArray, colIndex-1); - if(colStr == [NSNull null]) + if([colStr isNSNull]) [globalVar replaceCharactersInRange:aRange withString:@"NULL"]; else if([colStr isSPNotLoaded]) [globalVar replaceCharactersInRange:aRange withString:@""]; @@ -1414,7 +1414,7 @@ if ([cellData isSPNotLoaded]) cellData = NSArrayObjectAtIndex(fieldMappingTableDefaultValues, i); - if (cellData == [NSNull null]) { + if ([cellData isNSNull]) { [setString appendString:@"NULL"]; } else { [setString appendString:[mySQLConnection escapeAndQuoteString:cellData]]; @@ -1446,7 +1446,7 @@ NSInteger colIndex = [[globalVar substringWithRange:[globalVar rangeOfRegex:re capture:1L]] integerValue]; if(colIndex > 0 && colIndex <= (NSInteger)[csvRowArray count]) { id colStr = NSArrayObjectAtIndex(csvRowArray, colIndex-1); - if(colStr == [NSNull null]) + if([colStr isNSNull]) [globalVar replaceCharactersInRange:aRange withString:@"NULL"]; else if([colStr isSPNotLoaded]) [globalVar replaceCharactersInRange:aRange withString:@""]; @@ -1466,7 +1466,7 @@ if ([cellData isSPNotLoaded]) cellData = NSArrayObjectAtIndex(fieldMappingTableDefaultValues, i); - if (cellData == [NSNull null]) { + if ([cellData isNSNull]) { [whereString appendString:@" IS NULL"]; } else { [whereString appendString:@"="]; @@ -1521,7 +1521,7 @@ NSInteger colIndex = [[globalVar substringWithRange:[globalVar rangeOfRegex:re capture:1L]] integerValue]; if(colIndex > 0 && colIndex <= (NSInteger)[csvRowArray count]) { id colStr = NSArrayObjectAtIndex(csvRowArray, colIndex-1); - if(colStr == [NSNull null]) + if([colStr isNSNull]) [globalVar replaceCharactersInRange:aRange withString:@"NULL"]; else if([colStr isSPNotLoaded]) [globalVar replaceCharactersInRange:aRange withString:@""]; @@ -1542,7 +1542,7 @@ cellData = NSArrayObjectAtIndex(fieldMappingTableDefaultValues, i); // Insert a NULL if the cell is an NSNull, or is a nullable numeric field and empty - if (cellData == [NSNull null] || ([nullableNumericFieldsMapIndex containsIndex:i] && [[cellData description] isEqualToString:@""])) { + if ([cellData isNSNull] || ([nullableNumericFieldsMapIndex containsIndex:i] && [[cellData description] isEqualToString:@""])) { [valueString appendString:@"NULL"]; } else { |