summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergey Glukhov <Sergey.Glukhov@sun.com>2008-12-09 16:38:52 +0400
committerSergey Glukhov <Sergey.Glukhov@sun.com>2008-12-09 16:38:52 +0400
commit419e053a417f4ec771cc940be3c0b924cd868f9d (patch)
treea6e32b6af65569dab998e44d2caea17f3075a5ff /sql
parentd49d4298e9ca332fc345e2af5b19a932bb053215 (diff)
downloadmariadb-git-419e053a417f4ec771cc940be3c0b924cd868f9d.tar.gz
Bug#31291 ALTER TABLE CONVERT TO CHARACTER SET does not change some data types
added ability for TINY[MEDIUM] text fields to be converted to greater subtype during alter if necessary(altered charset) mysql-test/r/alter_table.result: test result mysql-test/t/alter_table.test: test case sql/sql_table.cc: added ability for TINY[MEDIUM] text fields to be converted to greater subtype during alter if necessary(altered charset)
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_table.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 8baeca9ccf7..eefe2a5596e 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -1535,7 +1535,9 @@ static bool prepare_blob_field(THD *thd, create_field *sql_field)
if ((sql_field->flags & BLOB_FLAG) && sql_field->length)
{
- if (sql_field->sql_type == FIELD_TYPE_BLOB)
+ if (sql_field->sql_type == FIELD_TYPE_BLOB ||
+ sql_field->sql_type == FIELD_TYPE_TINY_BLOB ||
+ sql_field->sql_type == FIELD_TYPE_MEDIUM_BLOB)
{
/* The user has given a length to the blob column */
sql_field->sql_type= get_blob_type_from_length(sql_field->length);