From e7db8779569191aeb3e4aea787ce6fbf4d23a57d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 24 Mar 2005 13:48:38 +0100 Subject: [PATCH] BUG#9303 blob field with specified length < 256 does not create tinyblob mysql-test/r/type_blob.result: Test creates a blob(250 whcih is now displayed as tinyblob when SHOW COLUMNS is called. sql/sql_parse.cc: Added missing else so that FIELD_TINY_BLOB can be selected --- mysql-test/r/type_blob.result | 2 +- sql/sql_parse.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index 12eb2902966..b1dc895ecc5 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -4,7 +4,7 @@ show columns from t1; Field Type Null Key Default Extra a blob YES NULL b text YES NULL -c blob YES NULL +c tinyblob YES NULL d mediumtext YES NULL e longtext YES NULL CREATE TABLE t2 (a char(257), b varbinary(70000), c varchar(70000000)); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 10d6ddc3f98..b699577d5e4 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4404,7 +4404,7 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type, /* The user has given a length to the blob column */ if (new_field->length < 256) type= FIELD_TYPE_TINY_BLOB; - if (new_field->length < 65536) + else if (new_field->length < 65536) type= FIELD_TYPE_BLOB; else if (new_field->length < 256L*256L*256L) type= FIELD_TYPE_MEDIUM_BLOB;