diff options
author | rowanbeentje <rowan@beent.je> | 2012-03-27 00:14:50 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2012-03-27 00:14:50 +0000 |
commit | 611dc52b10ecace3bc95df5645701fd23f165d37 (patch) | |
tree | 4d9281032ac397e8f5ffd7a348392ff61dfe6b6c /Source | |
parent | 0662b102085e03010305f80e7429c214a599b655 (diff) | |
download | sequelpro-611dc52b10ecace3bc95df5645701fd23f165d37.tar.gz sequelpro-611dc52b10ecace3bc95df5645701fd23f165d37.tar.bz2 sequelpro-611dc52b10ecace3bc95df5645701fd23f165d37.zip |
- Fix incorrect queries when building up an export by removing the additional semicolons. This addresses Issue #1311.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPSQLExporter.m | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/SPSQLExporter.m b/Source/SPSQLExporter.m index 6090b709..8ba6c160 100644 --- a/Source/SPSQLExporter.m +++ b/Source/SPSQLExporter.m @@ -378,7 +378,8 @@ id object = NSArrayObjectAtIndex(row, t); - // Add NULL values directly to the output row + // Add NULL values directly to the output row; use a pointer comparison to the singleton + // instance for speed. if (object == [NSNull null]) { [sqlString appendString:@"NULL"]; } @@ -494,7 +495,7 @@ } } - queryResult = [connection queryString:[NSString stringWithFormat:@"/*!50003 SHOW TRIGGERS WHERE `Table` = %@ */;", [tableName tickQuotedString]]]; + queryResult = [connection queryString:[NSString stringWithFormat:@"/*!50003 SHOW TRIGGERS WHERE `Table` = %@ */", [tableName tickQuotedString]]]; [queryResult setReturnDataAsStrings:YES]; @@ -590,7 +591,7 @@ if ([items count] == 0) continue; // Retrieve the definitions - queryResult = [connection queryString:[NSString stringWithFormat:@"/*!50003 SHOW %@ STATUS WHERE `Db` = %@ */;", procedureType, + queryResult = [connection queryString:[NSString stringWithFormat:@"/*!50003 SHOW %@ STATUS WHERE `Db` = %@ */", procedureType, [[self sqlDatabaseName] tickQuotedString]]]; [queryResult setReturnDataAsStrings:YES]; @@ -665,7 +666,7 @@ [NSArrayObjectAtIndex(procedureDefiner, 1) backtickQuotedString] ]; - SPMySQLResult *createProcedureResult = [connection queryString:[NSString stringWithFormat:@"/*!50003 SHOW CREATE %@ %@ */;;", procedureType, + SPMySQLResult *createProcedureResult = [connection queryString:[NSString stringWithFormat:@"/*!50003 SHOW CREATE %@ %@ */", procedureType, [procedureName backtickQuotedString]]]; [createProcedureResult setReturnDataAsStrings:YES]; if ([connection queryErrored]) { @@ -831,7 +832,8 @@ // Provide the field default if appropriate if ([column objectForKey:@"default"]) { - // Some MySQL server versions show a default of NULL for NOT NULL columns - don't export those + // Some MySQL server versions show a default of NULL for NOT NULL columns - don't export those. + // Check against the NSNull singleton instance for speed. if ([column objectForKey:@"default"] == [NSNull null]) { if ([[column objectForKey:@"null"] integerValue]) { [fieldString appendString:@" DEFAULT NULL"]; |