diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-10-09 20:38:39 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-10-09 20:38:39 +0000 |
commit | a4ae7f6898d3b978938869382667a83535c1a805 (patch) | |
tree | 80cba6928ae9dab763b2bdec1a873870e76ef8d3 /Source/SPDataImport.m | |
parent | 5841f3d9952a1c4d7c73d39e369ec7c78effb356 (diff) | |
download | sequelpro-a4ae7f6898d3b978938869382667a83535c1a805.tar.gz sequelpro-a4ae7f6898d3b978938869382667a83535c1a805.tar.bz2 sequelpro-a4ae7f6898d3b978938869382667a83535c1a805.zip |
• some code cleaning, speed improvements, commenting stuff
Diffstat (limited to 'Source/SPDataImport.m')
-rw-r--r-- | Source/SPDataImport.m | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Source/SPDataImport.m b/Source/SPDataImport.m index 00876c8d..d467e0a1 100644 --- a/Source/SPDataImport.m +++ b/Source/SPDataImport.m @@ -902,10 +902,14 @@ [insertBaseString appendString:@","]; else insertBaseStringHasEntries = YES; - // Store column index for each geometry field to be able to apply GeomFromText() while importing - if([geometryFields containsObject:fieldName = NSArrayObjectAtIndex(fieldMappingTableColumnNames, i) ]) - [geometryFieldsMapIndex addIndex:i]; - [insertBaseString appendString:[fieldName backtickQuotedString]]; + if([geometryFields count]) { + // Store column index for each geometry field to be able to apply GeomFromText() while importing + if([geometryFields containsObject:fieldName = NSArrayObjectAtIndex(fieldMappingTableColumnNames, i) ]) + [geometryFieldsMapIndex addIndex:i]; + [insertBaseString appendString:[fieldName backtickQuotedString]]; + } else { + [insertBaseString appendString:[NSArrayObjectAtIndex(fieldMappingTableColumnNames, i) backtickQuotedString]]; + } } } [insertBaseString appendString:@") VALUES\n"]; @@ -1353,7 +1357,7 @@ [valueString appendString:@"NULL"]; } else { // Apply GeomFromText() for each geometry field - if([geometryFieldsMapIndex containsIndex:i]) { + if([geometryFields count] && [geometryFieldsMapIndex containsIndex:i]) { [valueString appendFormat:@"GeomFromText('%@')", [mySQLConnection prepareString:cellData]]; } else { [valueString appendFormat:@"'%@'", [mySQLConnection prepareString:cellData]]; |