diff options
author | unknown <gluh@mysql.com> | 2006-03-29 19:53:40 +0500 |
---|---|---|
committer | unknown <gluh@mysql.com> | 2006-03-29 19:53:40 +0500 |
commit | c819b62bcb062c5dcee9f3dddd8aa9922f5aa259 (patch) | |
tree | 1f830efabf9a02bc64dc213db2927f20a804b0f3 /sql/sql_table.cc | |
parent | 0fb36d1b1e665b424492674aec283de852a1296a (diff) | |
parent | 4af4e1e704f224d95cacc465e9cffc59a52aae7e (diff) | |
download | mariadb-git-c819b62bcb062c5dcee9f3dddd8aa9922f5aa259.tar.gz |
Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/gluh/MySQL/Merge/4.1
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 616db8b0424..21f597caf94 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -540,6 +540,11 @@ 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++) { if (String::needs_conversion(tmp->length(), tmp->charset(), @@ -559,6 +564,18 @@ 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 } |