diff options
author | unknown <gluh@mysql.com> | 2006-03-30 08:13:28 +0500 |
---|---|---|
committer | unknown <gluh@mysql.com> | 2006-03-30 08:13:28 +0500 |
commit | a7431720ce85073aae45c06d4531c581be34d974 (patch) | |
tree | 3bd6c5acf0e606ef58cea4d0d43e5f1b3f7b3171 /sql/sql_table.cc | |
parent | e672bb700459dda159ef5ab48388fcb5a755db12 (diff) | |
parent | c819b62bcb062c5dcee9f3dddd8aa9922f5aa259 (diff) | |
download | mariadb-git-a7431720ce85073aae45c06d4531c581be34d974.tar.gz |
Merge
mysql-test/t/create.test:
Auto merged
sql/sql_table.cc:
Auto merged
mysql-test/r/create.result:
SCCS merged
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 4975bbaaaf1..8f13e612050 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -741,6 +741,11 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, sql_field->interval_list); List_iterator<String> it(sql_field->interval_list); String conv, *tmp; + char comma_buf[2]; + int comma_length= cs->cset->wc_mb(cs, ',', (uchar*) comma_buf, + (uchar*) comma_buf + + sizeof(comma_buf)); + DBUG_ASSERT(comma_length > 0); for (uint i= 0; (tmp= it++); i++) { uint lengthsp; @@ -759,6 +764,18 @@ static int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, interval->type_lengths[i]); interval->type_lengths[i]= lengthsp; ((uchar *)interval->type_names[i])[lengthsp]= '\0'; + if (sql_field->sql_type == FIELD_TYPE_SET) + { + if (cs->coll->instr(cs, interval->type_names[i], + interval->type_lengths[i], + comma_buf, comma_length, NULL, 0)) + { + my_printf_error(ER_UNKNOWN_ERROR, + "Illegal %s '%-.64s' value found during parsing", + MYF(0), "set", tmp->ptr()); + DBUG_RETURN(-1); + } + } } sql_field->interval_list.empty(); // Don't need interval_list anymore } |