aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-06-10 10:51:33 +0000
committerBibiko <bibiko@eva.mpg.de>2009-06-10 10:51:33 +0000
commitbea8a9f461a9a9566b28d208b47db772591ac0fa (patch)
tree283bc6de82d88ef93fcbb590d7815826dc321b61
parent2d722887095bb2eca1b0ab9bbaf04c9da2416765 (diff)
downloadsequelpro-bea8a9f461a9a9566b28d208b47db772591ac0fa.tar.gz
sequelpro-bea8a9f461a9a9566b28d208b47db772591ac0fa.tar.bz2
sequelpro-bea8a9f461a9a9566b28d208b47db772591ac0fa.zip
• fixed some minor issues in fetchResultFieldsStructure
- detection tiny/medium blob now uses length/max_lengthOfCharOfEnc - dropped mac_char_length key from dict because it's not possible to calculate the correct max_length in a given encoding
-rw-r--r--Source/CMMCPResult.m12
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/CMMCPResult.m b/Source/CMMCPResult.m
index b970b17d..701e614c 100644
--- a/Source/CMMCPResult.m
+++ b/Source/CMMCPResult.m
@@ -364,8 +364,8 @@ modified version for use with sequel-pro
/* Max width (bytes) for selected set */
[fieldStructure setObject:[NSNumber numberWithUnsignedLongLong:theField[i].max_length] forKey:@"max_byte_length"];
/* Max width (chars) for selected set */
- [fieldStructure setObject:[NSNumber numberWithUnsignedLongLong:theField[i].max_length/[self find_charsetMaxByteLengthPerChar:theField[i].charsetnr]]
- forKey:@"max_char_length"];
+ // [fieldStructure setObject:[NSNumber numberWithUnsignedLongLong:theField[i].max_length/[self find_charsetMaxByteLengthPerChar:theField[i].charsetnr]]
+ // forKey:@"max_char_length"];
/* Div flags */
[fieldStructure setObject:[NSNumber numberWithUnsignedInt:theField[i].flags] forKey:@"flags"];
@@ -466,7 +466,7 @@ modified version for use with sequel-pro
case MYSQL_TYPE_BLOB:
{
BOOL isBlob = (charsetnr == MAGIC_BINARY_CHARSET_NR);
- switch (length) {
+ switch ((int)length/[self find_charsetMaxByteLengthPerChar:charsetnr]) {
case 255: return isBlob? @"TINYBLOB":@"TINYTEXT";
case 65535: return isBlob? @"BLOB":@"TEXT";
case 16777215: return isBlob? @"MEDIUMBLOB":@"MEDIUMTEXT";
@@ -564,9 +564,11 @@ modified version for use with sequel-pro
case MYSQL_TYPE_LONG_BLOB:// should no appear over the wire
case MYSQL_TYPE_BLOB:
{
- if (charsetnr == MAGIC_BINARY_CHARSET_NR)
+ if (charsetnr == MAGIC_BINARY_CHARSET_NR) {
return @"blobdata";
- return @"textdata";
+ } else {
+ return @"textdata";
+ }
}
case MYSQL_TYPE_GEOMETRY:
return @"geometry";