summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <msvensson@neptunus.(none)>2005-03-24 18:11:13 +0100
committerunknown <msvensson@neptunus.(none)>2005-03-24 18:11:13 +0100
commitd0b3cb68be94cf25e1bc009b66e8669ce3f6f1cb (patch)
tree2d8e5a9390ae45759cba5fb696cb3c145ea5ce91 /sql
parentfa4a075b6cb7ba7e71c842e6649bf7e7c516bef2 (diff)
parentfe5793342c8d4a27ac5293c7893d3379ae2bcb85 (diff)
downloadmariadb-git-d0b3cb68be94cf25e1bc009b66e8669ce3f6f1cb.tar.gz
Manual merge
mysql-test/r/type_blob.result: Auto merged sql/mysqld.cc: Auto merged sql/sql_parse.cc: Strange merge conflict
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_parse.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index d765561f61e..45918a6b3af 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -5403,6 +5403,20 @@ new_create_field(THD *thd, char *field_name, enum_field_types type,
case FIELD_TYPE_LONG_BLOB:
case FIELD_TYPE_MEDIUM_BLOB:
case FIELD_TYPE_GEOMETRY:
+ if (new_field->length)
+ {
+ /* The user has given a length to the blob column */
+ if (new_field->length < 256)
+ type= FIELD_TYPE_TINY_BLOB;
+ else if (new_field->length < 65536)
+ type= FIELD_TYPE_BLOB;
+ else if (new_field->length < 256L*256L*256L)
+ type= FIELD_TYPE_MEDIUM_BLOB;
+ else
+ type= FIELD_TYPE_LONG_BLOB;
+ new_field->length= 0;
+ }
+ new_field->sql_type= type;
if (default_value) // Allow empty as default value
{
String str,*res;