aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTablesList.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2011-10-09 19:16:55 +0000
committerstuconnolly <stuart02@gmail.com>2011-10-09 19:16:55 +0000
commitc8c91195ad32456400fc55377a33d466b6832ab3 (patch)
tree1c5bc316ae6138d3c396dba8c0583b1beb987e38 /Source/SPTablesList.m
parent1fc5d271f03e0dc61605274aa87eb185a21e3f54 (diff)
downloadsequelpro-c8c91195ad32456400fc55377a33d466b6832ab3.tar.gz
sequelpro-c8c91195ad32456400fc55377a33d466b6832ab3.tar.bz2
sequelpro-c8c91195ad32456400fc55377a33d466b6832ab3.zip
For some reason table creation on MySQL 4.0 servers doesn't like the engine/type being quoted.
Diffstat (limited to 'Source/SPTablesList.m')
-rw-r--r--Source/SPTablesList.m3
1 files changed, 1 insertions, 2 deletions
diff --git a/Source/SPTablesList.m b/Source/SPTablesList.m
index f82207dc..97055611 100644
--- a/Source/SPTablesList.m
+++ b/Source/SPTablesList.m
@@ -2248,7 +2248,6 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable";
*/
- (void)_addTable
{
-
// Ensure the task is performed on a background thread to group addition and loads
if ([NSThread isMainThread]) {
[NSThread detachNewThreadSelector:@selector(_addTable) toTarget:self withObject:nil];
@@ -2279,7 +2278,7 @@ static NSString *SPDuplicateTable = @"SPDuplicateTable";
// If there is a type selected other than the default we must specify it in CREATE TABLE statement
if ([tableTypeButton indexOfSelectedItem] > 0) {
- engineStatement = [NSString stringWithFormat:@"%@ = %@", [[tableDocumentInstance serverSupport] engineTypeQueryName], [tableType backtickQuotedString]];
+ engineStatement = [NSString stringWithFormat:@"%@ = %@", [[tableDocumentInstance serverSupport] engineTypeQueryName], [[tableDocumentInstance serverSupport] supportsQuotingEngineTypeInCreateSyntax] ? [tableType backtickQuotedString] : tableType];
}
NSString *createStatement = [NSString stringWithFormat:@"CREATE TABLE %@ (id INT(11) UNSIGNED NOT NULL%@) %@ %@", [tableName backtickQuotedString], [tableType isEqualToString:@"CSV"] ? @"" : @" PRIMARY KEY AUTO_INCREMENT", charSetStatement, engineStatement];