From 283e047e8ad265cc05f320d9eb08558cb7c51a97 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Fri, 5 Dec 2008 00:42:39 +0000 Subject: Fix for Issue #71 - correctly adds the hexadecimal specifier before hex strings, fixing the data corruption problems in all TEXT/BLOB types --- TableContent.m | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'TableContent.m') diff --git a/TableContent.m b/TableContent.m index 6610ceb1..60045a75 100644 --- a/TableContent.m +++ b/TableContent.m @@ -1083,10 +1083,7 @@ } else if ( [rowObject isKindOfClass:[NSNumber class]] ) { [rowValue setString:[rowObject stringValue]]; } else if ( [rowObject isKindOfClass:[NSData class]] ) { - //problem: if a blob field is edited, it becomes a string and is not more prepared as binary data - // but probably blob fields are corrupted before, when they decoded in the tableView method - // [rowValue setString:[NSString stringWithFormat:@"\"%@\"", [mySQLConnection prepareBinaryData:rowObject]]]; - [rowValue setString:[NSString stringWithFormat:@"'%@'", [mySQLConnection prepareBinaryData:rowObject]]]; + [rowValue setString:[NSString stringWithFormat:@"X'%@'", [mySQLConnection prepareBinaryData:rowObject]]]; } else { // [rowValue setString:[NSString stringWithFormat:@"\"%@\"", [mySQLConnection prepareString:[rowObject description]]]]; if ( [[rowObject description] isEqualToString:@"CURRENT_TIMESTAMP"] ) { -- cgit v1.2.3