diff options
author | rowanbeentje <rowan@beent.je> | 2013-03-19 01:32:28 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2013-03-19 01:32:28 +0000 |
commit | 46dd5cd5a759eb38aacc2e7f6e5f757fee60d3c2 (patch) | |
tree | 7b67782314f7ce52d8b95ec844532fddb85e2847 /Source/SPTableStructureDelegate.m | |
parent | f3b93d4d0d3bf2cbeb9bd512781e93d4c630f752 (diff) | |
download | sequelpro-46dd5cd5a759eb38aacc2e7f6e5f757fee60d3c2.tar.gz sequelpro-46dd5cd5a759eb38aacc2e7f6e5f757fee60d3c2.tar.bz2 sequelpro-46dd5cd5a759eb38aacc2e7f6e5f757fee60d3c2.zip |
- Fix errors when editing or moving columns on server vesions which do not support character sets/collations, addressing Issue #1629
- Fix needless collation queries on those servers
- Disable field enums and table encoding dropdown on those servers
Diffstat (limited to 'Source/SPTableStructureDelegate.m')
-rw-r--r-- | Source/SPTableStructureDelegate.m | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/SPTableStructureDelegate.m b/Source/SPTableStructureDelegate.m index 27a7cfe9..a9f2a949 100644 --- a/Source/SPTableStructureDelegate.m +++ b/Source/SPTableStructureDelegate.m @@ -38,6 +38,7 @@ #import "SPTableView.h" #import "SPTableFieldValidation.h" #import "SPTableStructureLoading.h" +#import "SPServerSupport.h" #import <SPMySQL/SPMySQL.h> @@ -310,7 +311,7 @@ NSString *fieldEncoding = @""; - if ([[originalRow objectForKey:@"encoding"] integerValue] > 0) { + if ([[originalRow objectForKey:@"encoding"] integerValue] > 0 && [[tableDocumentInstance serverSupport] supportsPost41CharacterSetHandling]) { NSString *enc = [[encodingPopupCell itemAtIndex:[[originalRow objectForKey:@"encoding"] integerValue]] title]; NSInteger start = [enc rangeOfString:@"("].location + 1; @@ -557,12 +558,12 @@ // Only string fields allow encoding settings if (([[aTableColumn identifier] isEqualToString:@"encoding"])) { - [aCell setEnabled:([fieldValidation isFieldTypeString:theRowType] && ![theRowType hasSuffix:@"BINARY"] && ![theRowType hasSuffix:@"BLOB"])]; + [aCell setEnabled:([fieldValidation isFieldTypeString:theRowType] && ![theRowType hasSuffix:@"BINARY"] && ![theRowType hasSuffix:@"BLOB"]) && [[tableDocumentInstance serverSupport] supportsPost41CharacterSetHandling]]; } // Only string fields allow collation settings and string field is not set to BINARY since BINARY sets the collation to *_bin else if ([[aTableColumn identifier] isEqualToString:@"collation"]) { - [aCell setEnabled:([fieldValidation isFieldTypeString:theRowType] && [[theRow objectForKey:@"binary"] integerValue] == 0 && ![theRowType hasSuffix:@"BINARY"] && ![theRowType hasSuffix:@"BLOB"])]; + [aCell setEnabled:([fieldValidation isFieldTypeString:theRowType] && [[theRow objectForKey:@"binary"] integerValue] == 0 && ![theRowType hasSuffix:@"BINARY"] && ![theRowType hasSuffix:@"BLOB"] && [[tableDocumentInstance serverSupport] supportsPost41CharacterSetHandling])]; } // Check if UNSIGNED and ZEROFILL is allowed |