From f3b93d4d0d3bf2cbeb9bd512781e93d4c630f752 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Sun, 17 Mar 2013 16:46:30 +0000 Subject: 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 --- Source/SPTableStructureDelegate.m | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'Source') 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"]; -- cgit v1.2.3