From f1b326a1f2593115fb9542b4488c3c3691220aab Mon Sep 17 00:00:00 2001 From: Bibiko Date: Tue, 14 Sep 2010 11:01:25 +0000 Subject: =?UTF-8?q?=E2=80=A2=C2=A0(re=3F)enabled=20BIT=20field=20editing?= =?UTF-8?q?=20esp.=20for=20field=20types=20like=20BIT(9)=20or=20BIT(63)=20?= =?UTF-8?q?since=20the=20old=20=5Fint2bin=20routine=20didn't=20work=20beca?= =?UTF-8?q?use=20we're=20dealing=20with=20a=20char*=20containing=20bytes?= =?UTF-8?q?=20if=20BIT(>8)=20-=20also=20for=20views=20and=20CustomQuery=20?= =?UTF-8?q?editing=20=E2=80=A2=20started=20to=20clean=20up=20(VAR)BINARY?= =?UTF-8?q?=20editing=20(work=20in=20progress)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPCustomQuery.m | 5 ++++- Source/SPTableContent.m | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'Source') diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index 961ae6e9..6818dd7f 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -1731,11 +1731,14 @@ [fieldIDQueryStr appendFormat:@"%@='%@' AND ", [[field objectForKey:@"org_name"] backtickQuotedString], [mySQLConnection prepareString:aValue]]; } } - else if ([[field objectForKey:@"typegrouping"] isEqualToString:@"blobdata"] || [[field objectForKey:@"type"] isEqualToString:@"BINARY"]) { + else if ([[field objectForKey:@"typegrouping"] isEqualToString:@"blobdata"] || [[field objectForKey:@"type"] isEqualToString:@"BINARY"] || [[field objectForKey:@"type"] isEqualToString:@"VARBINARY"]) { if(includeBlobs) { [fieldIDQueryStr appendFormat:@"%@=X'%@' AND ", [[field objectForKey:@"org_name"] backtickQuotedString], [mySQLConnection prepareBinaryData:aValue]]; } } + else if ([[field objectForKey:@"typegrouping"] isEqualToString:@"bit"]) { + [fieldIDQueryStr appendFormat:@"%@=b'%@' AND ", [[field objectForKey:@"org_name"] backtickQuotedString], [aValue description]]; + } else if ([[field objectForKey:@"typegrouping"] isEqualToString:@"integer"]) { [fieldIDQueryStr appendFormat:@"%@=%@ AND ", [[field objectForKey:@"org_name"] backtickQuotedString], [aValue description]]; } diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index 3285dc0f..92b9ad15 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -1420,11 +1420,14 @@ [fieldIDQueryStr appendFormat:@"%@='%@' AND ", [[field objectForKey:@"org_name"] backtickQuotedString], [mySQLConnection prepareString:aValue]]; } } - else if ([[field objectForKey:@"typegrouping"] isEqualToString:@"blobdata"] || [[field objectForKey:@"type"] isEqualToString:@"BINARY"]) { + else if ([[field objectForKey:@"typegrouping"] isEqualToString:@"blobdata"] || [[field objectForKey:@"type"] isEqualToString:@"BINARY"] || [[field objectForKey:@"type"] isEqualToString:@"VARBINARY"]) { if(includeBlobs) { [fieldIDQueryStr appendFormat:@"%@=X'%@' AND ", [[field objectForKey:@"org_name"] backtickQuotedString], [mySQLConnection prepareBinaryData:aValue]]; } } + else if ([[field objectForKey:@"typegrouping"] isEqualToString:@"bit"]) { + [fieldIDQueryStr appendFormat:@"%@=b'%@' AND ", [[field objectForKey:@"org_name"] backtickQuotedString], [aValue description]]; + } else if ([[field objectForKey:@"typegrouping"] isEqualToString:@"integer"]) { [fieldIDQueryStr appendFormat:@"%@=%@ AND ", [[field objectForKey:@"org_name"] backtickQuotedString], [aValue description]]; } -- cgit v1.2.3