aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/MCPKit/MCPFoundationKit
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2011-05-05 16:33:16 +0000
committerBibiko <bibiko@eva.mpg.de>2011-05-05 16:33:16 +0000
commitde27c6e8f75c00cf5f28fdd5d6f8f1acc740320d (patch)
tree770e10a7ce59496e367a3c983afaa1d205c488dd /Frameworks/MCPKit/MCPFoundationKit
parent27102ed2925b18be9e55ba529937f6f0a4d23eaf (diff)
downloadsequelpro-de27c6e8f75c00cf5f28fdd5d6f8f1acc740320d.tar.gz
sequelpro-de27c6e8f75c00cf5f28fdd5d6f8f1acc740320d.tar.bz2
sequelpro-de27c6e8f75c00cf5f28fdd5d6f8f1acc740320d.zip
• improve BIT field type support
- caught some more exceptional cases - re-factored byte to bit conversion (really do not know why the old code wasn't working anymore); this should fix i1042 - disabled unisgned/zerofill check boxes in Structure for BIT - insert correct default BIT field default value if any after adding a new row -- this works for 5.5 but for MySQL 5.0.x it seems that providing a default value is a MySQL bug (further checks are needed)
Diffstat (limited to 'Frameworks/MCPKit/MCPFoundationKit')
-rw-r--r--Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.m16
1 files changed, 13 insertions, 3 deletions
diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.m b/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.m
index ec4aa44b..bdb271fe 100644
--- a/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.m
+++ b/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.m
@@ -430,12 +430,22 @@ void _bytes2bin(Byte *n, NSUInteger nbytes, NSUInteger len, char *buf);
void _bytes2bin(Byte *n, NSUInteger nbytes, NSUInteger len, char *buf)
{
+ // NSUInteger i = 0;
+ // nbytes--;
+ // while (++i <= len)
+ // buf[len - i] = ( (n[nbytes - (i >> 3)] >> (i & 0x7)) & 1 ) ? '1' : '0';
+ //
+ // buf[len] = '\0';
+ // ↑ why does this code not working anymore?
+
NSUInteger i = 0;
nbytes--;
- while (++i <= len)
- buf[len - i] = ( (n[nbytes - (i >> 3)] >> (i & 0x7)) & 1 ) ? '1' : '0';
+ len--;
+ while (i <= len)
+ buf[len - i++] = ( (n[nbytes - (i >> 3)] >> (i & 0x7)) & 1 ) ? '1' : '0';
+
+ buf[len+1] = '\0';
- buf[len] = '\0';
}
/**