aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2013-03-17 16:46:30 +0000
committerrowanbeentje <rowan@beent.je>2013-03-17 16:46:30 +0000
commitf3b93d4d0d3bf2cbeb9bd512781e93d4c630f752 (patch)
treeb3aadeb7055c48957eb498baeaa0935b07bfb9c2
parentaeb18ba57dd1fe9332d937118123e283112d1fc3 (diff)
downloadsequelpro-f3b93d4d0d3bf2cbeb9bd512781e93d4c630f752.tar.gz
sequelpro-f3b93d4d0d3bf2cbeb9bd512781e93d4c630f752.tar.bz2
sequelpro-f3b93d4d0d3bf2cbeb9bd512781e93d4c630f752.zip
Make some small tweaks to string BINARY handling:
- Correctly send the binary state/collation when reordering fields, addressing Issue #1265 - Allow unticking of the binary box to save correctly, allowing conversion of fields to non-binary collations again
-rw-r--r--Source/SPTableStructureDelegate.m8
1 files changed, 3 insertions, 5 deletions
diff --git a/Source/SPTableStructureDelegate.m b/Source/SPTableStructureDelegate.m
index bb7d99be..27a7cfe9 100644
--- a/Source/SPTableStructureDelegate.m
+++ b/Source/SPTableStructureDelegate.m
@@ -141,12 +141,10 @@
[tableSourceView reloadData];
}
}
- // Reset collation if BINARY was set to 1 since BINARY sets collation to *_bin
+ // Reset collation if BINARY was set changed, as enabling BINARY sets collation to *_bin
else if([[aTableColumn identifier] isEqualToString:@"binary"]) {
if([[currentRow objectForKey:@"binary"] integerValue] != [anObject integerValue]) {
- if([anObject integerValue] == 1) {
- [currentRow setObject:[NSNumber numberWithInteger:0] forKey:@"collation"];
- }
+ [currentRow setObject:[NSNumber numberWithInteger:0] forKey:@"collation"];
[tableSourceView reloadData];
}
@@ -326,7 +324,7 @@
fieldEncoding = [tableDataInstance tableEncoding];
}
- if ([fieldEncoding length] && [[originalRow objectForKey:@"collation"] integerValue] > 0) {
+ if ([fieldEncoding length] && [[originalRow objectForKey:@"collation"] integerValue] > 0 && ![[originalRow objectForKey:@"binary"] integerValue]) {
NSArray *theCollations = [databaseDataInstance getDatabaseCollationsForEncoding:fieldEncoding];
NSString *col = [[theCollations objectAtIndex:[[originalRow objectForKey:@"collation"] integerValue] - 1] objectForKey:@"COLLATION_NAME"];