aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableStructureDelegate.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-02-23 02:13:56 +0000
committerrowanbeentje <rowan@beent.je>2012-02-23 02:13:56 +0000
commit05f1612cbb7e33cf9135a346fc2505cc0e87e853 (patch)
tree785824be4e44a61389271343d958851fa4ff7dd0 /Source/SPTableStructureDelegate.m
parenta889340b9cb1eca0d3ff022e8e6e2c718480bf44 (diff)
downloadsequelpro-05f1612cbb7e33cf9135a346fc2505cc0e87e853.tar.gz
sequelpro-05f1612cbb7e33cf9135a346fc2505cc0e87e853.tar.bz2
sequelpro-05f1612cbb7e33cf9135a346fc2505cc0e87e853.zip
Warning: this branch commit is largely untested, and known to throw exceptions as database structure retrieval is currently missing!
Further work on SPMySQLFramework integration: - Improve SPMySQL framework build settings including correct ppc builds and a Distribution configuration for the build distributions to match - Add new convenience querying and result methods to the framework - Amend Sequel Pro source to use the new SPMySQL.framework methods everywhere, replacing MCPKit methods where they differ and improving some functions - Remove MCPKit from the source - Fix a number of warnings on Release-style builds
Diffstat (limited to 'Source/SPTableStructureDelegate.m')
-rw-r--r--Source/SPTableStructureDelegate.m7
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/SPTableStructureDelegate.m b/Source/SPTableStructureDelegate.m
index 997bfea2..6493e850 100644
--- a/Source/SPTableStructureDelegate.m
+++ b/Source/SPTableStructureDelegate.m
@@ -30,6 +30,7 @@
#import "SPTableData.h"
#import "SPTableView.h"
#import "SPTableFieldValidation.h"
+#import "SPMySQL.h"
@implementation SPTableStructure (SPTableStructureDelegate)
@@ -328,13 +329,13 @@
[queryString appendString:@" DEFAULT CURRENT_TIMESTAMP"];
}
else if ([(NSString *)[originalRow objectForKey:@"default"] length]) {
- [queryString appendFormat:@" DEFAULT '%@'", [mySQLConnection prepareString:[originalRow objectForKey:@"default"]]];
+ [queryString appendFormat:@" DEFAULT %@", [mySQLConnection escapeAndQuoteString:[originalRow objectForKey:@"default"]]];
}
}
// Any column comments
if ([(NSString *)[originalRow objectForKey:@"comment"] length]) {
- [queryString appendFormat:@" COMMENT '%@'", [mySQLConnection prepareString:[originalRow objectForKey:@"comment"]]];
+ [queryString appendFormat:@" COMMENT %@", [mySQLConnection escapeAndQuoteString:[originalRow objectForKey:@"comment"]]];
}
// Unparsed details - column formats, storage, reference definitions
@@ -355,7 +356,7 @@
if ([mySQLConnection queryErrored]) {
SPBeginAlertSheet(NSLocalizedString(@"Error moving field", @"error moving field message"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [tableDocumentInstance parentWindow], self, nil, nil,
- [NSString stringWithFormat:NSLocalizedString(@"An error occurred while trying to move the field.\n\nMySQL said: %@", @"error moving field informative message"), [mySQLConnection getLastErrorMessage]]);
+ [NSString stringWithFormat:NSLocalizedString(@"An error occurred while trying to move the field.\n\nMySQL said: %@", @"error moving field informative message"), [mySQLConnection lastErrorMessage]]);
}
else {
[tableDataInstance resetAllData];