diff options
author | rowanbeentje <rowan@beent.je> | 2011-09-22 23:41:48 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2011-09-22 23:41:48 +0000 |
commit | 4c64b79dc24bc1d8e61aff59176c27059bd0313c (patch) | |
tree | fa5c655be1f17008f18eac4c97c2da1b29740949 | |
parent | 549d28e50a35d432531926a6916755dbe26d91c4 (diff) | |
download | sequelpro-4c64b79dc24bc1d8e61aff59176c27059bd0313c.tar.gz sequelpro-4c64b79dc24bc1d8e61aff59176c27059bd0313c.tar.bz2 sequelpro-4c64b79dc24bc1d8e61aff59176c27059bd0313c.zip |
- Fix editing of binary string values, a regression in r3428; addresses log 2665
-rw-r--r-- | Source/SPCustomQuery.m | 3 | ||||
-rw-r--r-- | Source/SPTableContent.m | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index bb32eb41..415552df 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -2420,6 +2420,9 @@ if (!useFieldEditor && ![[columnDefinition objectForKey:@"typegrouping"] isEqualToString:@"enum"] && isBlob) useFieldEditor = YES; if (!useFieldEditor) { id cellValue = [resultData cellDataAtRow:rowIndex column:[[aTableColumn identifier] integerValue]]; + if ([cellValue isKindOfClass:[NSData class]]) { + cellValue = [[[NSString alloc] initWithData:cellValue encoding:[mySQLConnection stringEncoding]] autorelease]; + } if (![cellValue isNSNull] && [[columnDefinition objectForKey:@"typegrouping"] isEqualToString:@"string"] && [cellValue rangeOfCharacterFromSet:[NSCharacterSet newlineCharacterSet] options:NSLiteralSearch].location != NSNotFound) diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index 4f12f021..81bc44f6 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -4438,6 +4438,9 @@ if (!useFieldEditor && ![[columnDefinition objectForKey:@"typegrouping"] isEqualToString:@"enum"] && isBlob) useFieldEditor = YES; if (!useFieldEditor) { id cellValue = [tableValues cellDataAtRow:rowIndex column:[[aTableColumn identifier] integerValue]]; + if ([cellValue isKindOfClass:[NSData class]]) { + cellValue = [[[NSString alloc] initWithData:cellValue encoding:[mySQLConnection stringEncoding]] autorelease]; + } if (![cellValue isNSNull] && [[columnDefinition objectForKey:@"typegrouping"] isEqualToString:@"string"] && [cellValue rangeOfCharacterFromSet:[NSCharacterSet newlineCharacterSet] options:NSLiteralSearch].location != NSNotFound) |