aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPServerSupport.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2011-01-13 00:51:39 +0000
committerrowanbeentje <rowan@beent.je>2011-01-13 00:51:39 +0000
commit15ad4cdf44427d5a9595a0d7a15257ed79eae8ae (patch)
tree247e33de73bd9fb41291c3bea7cb1c08256be03f /Source/SPServerSupport.m
parentff134517f81971fce5ee5636aab9d2051ffa7705 (diff)
downloadsequelpro-15ad4cdf44427d5a9595a0d7a15257ed79eae8ae.tar.gz
sequelpro-15ad4cdf44427d5a9595a0d7a15257ed79eae8ae.tar.bz2
sequelpro-15ad4cdf44427d5a9595a0d7a15257ed79eae8ae.zip
- Add a new -engineTypeQueryName method to SPServerSupport, with a correct split between TYPE or ENGINE depending on database version.
- Update CREATE TABLE and ALERT TABLE queries to use this, fixing custom-type table creation on MySQL <4 and table type changes on MySQL >= 5.5. This addresses Issue #947.
Diffstat (limited to 'Source/SPServerSupport.m')
-rw-r--r--Source/SPServerSupport.m7
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/SPServerSupport.m b/Source/SPServerSupport.m
index 0b3ba79d..6f8213d6 100644
--- a/Source/SPServerSupport.m
+++ b/Source/SPServerSupport.m
@@ -54,6 +54,7 @@
@synthesize supportsFullDropUser;
@synthesize supportsUserMaxVars;
@synthesize supportsShowPrivileges;
+@synthesize engineTypeQueryName;
@synthesize supportsInformationSchemaEngines;
@synthesize supportsPre41StorageEngines;
@synthesize supportsBlackholeStorageEngine;
@@ -150,7 +151,10 @@
// The SHOW PRIVILEGES statement wasn't added until MySQL 4.1.0
supportsShowPrivileges = [self isEqualToOrGreaterThanMajorVersion:4 minor:1 release:0];
-
+
+ // MySQL 4.0.18+ and 4.1.2+ changed the TYPE option to ENGINE, but 4.x supports both
+ engineTypeQueryName = [self isEqualToOrGreaterThanMajorVersion:5 minor:0 release:0]?@"ENGINE":@"TYPE";
+
// Before MySQL 4.1 the MEMORY engine was known as HEAP and the ISAM engine was available
supportsPre41StorageEngines = (![self isEqualToOrGreaterThanMajorVersion:4 minor:1 release:0]);
@@ -245,6 +249,7 @@
supportsFullDropUser = NO;
supportsUserMaxVars = NO;
supportsShowPrivileges = NO;
+ engineTypeQueryName = @"ENGINE";
supportsInformationSchemaEngines = NO;
supportsPre41StorageEngines = NO;
supportsBlackholeStorageEngine = NO;