diff options
author | Max <post@wickenrode.com> | 2015-04-16 00:24:53 +0200 |
---|---|---|
committer | Max <post@wickenrode.com> | 2015-04-16 00:24:53 +0200 |
commit | 028f1ff9ac1e22db9abec6ea3838079a08aa471e (patch) | |
tree | 547215225796afb958a27e29f99eed0bb6e393ed /Source/SPServerSupport.m | |
parent | 8f27fbe9ca78b8258809d1266820095361b46a13 (diff) | |
download | sequelpro-028f1ff9ac1e22db9abec6ea3838079a08aa471e.tar.gz sequelpro-028f1ff9ac1e22db9abec6ea3838079a08aa471e.tar.bz2 sequelpro-028f1ff9ac1e22db9abec6ea3838079a08aa471e.zip |
Restore detailed error messages for FK errors in MySQL 5.5+
Diffstat (limited to 'Source/SPServerSupport.m')
-rw-r--r-- | Source/SPServerSupport.m | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Source/SPServerSupport.m b/Source/SPServerSupport.m index 5537e476..489acc04 100644 --- a/Source/SPServerSupport.m +++ b/Source/SPServerSupport.m @@ -77,6 +77,7 @@ @synthesize serverMinorVersion; @synthesize serverReleaseVersion; @synthesize supportsFulltextOnInnoDB; +@synthesize supportsShowEngine; #pragma mark - #pragma mark Initialisation @@ -200,6 +201,28 @@ // Fractional second support wasn't added until MySQL 5.6.4 supportsFractionalSeconds = [self isEqualToOrGreaterThanMajorVersion:5 minor:6 release:4]; supportsFulltextOnInnoDB = supportsFractionalSeconds; //introduced in 5.6.4 too + + // The SHOW ENGINE query wasn't added until MySQL 4.1.2 + supportsShowEngine = [self isEqualToOrGreaterThanMajorVersion:4 minor:1 release:2]; +} + +- (SPInnoDBStatusQueryFormat)innoDBStatusQuery +{ + SPInnoDBStatusQueryFormat tuple = {nil,0}; + + //if we have SHOW ENGINE go with that + if(supportsShowEngine) { + tuple.queryString = @"SHOW ENGINE INNODB STATUS"; + tuple.columnIndex = 2; + } + //up to mysql 5.5 we could also use the old SHOW INNODB STATUS + if([self isEqualToOrGreaterThanMajorVersion:3 minor:23 release:52] && + ![self isEqualToOrGreaterThanMajorVersion:5 minor:5 release:0]) { + tuple.queryString = @"SHOW INNODB STATUS"; + tuple.columnIndex = 0; + } + + return tuple; } /** @@ -291,6 +314,7 @@ supportsQuotingEngineTypeInCreateSyntax = NO; supportsFractionalSeconds = NO; supportsFulltextOnInnoDB = NO; + supportsShowEngine = NO; } /** |