Commit 4ead562d authored by marko's avatar marko

branches/zip: Merge c2998 from branches/6.0, so that the same InnoDB Plugin

source tree will work both under 5.1 and 6.0.  Do not add the test case
innodb_ctype_ldml.test, because it would not work under MySQL 5.1.

Refuse to create tables whose columns contain collation IDs above 255.
This removes an assertion failure that was introduced in WL#4164
(Two-byte collation IDs).

create_table_def(): Do not fail an assertion if a column contains a
charset-collation ID greater than 256. Instead, issue an error and
refuse to create the table.

The original change (branches/6.0 r2998) was rb://51 approved by Calvin Sun.
parent c19234cc
...@@ -5473,9 +5473,19 @@ create_table_def( ...@@ -5473,9 +5473,19 @@ create_table_def(
charset_no = (ulint)field->charset()->number; charset_no = (ulint)field->charset()->number;
ut_a(charset_no < 256); /* in data0type.h we assume if (UNIV_UNLIKELY(charset_no >= 256)) {
that the number fits in one /* in data0type.h we assume that the
byte */ number fits in one byte in prtype */
push_warning_printf(
(THD*) trx->mysql_thd,
MYSQL_ERROR::WARN_LEVEL_ERROR,
ER_CANT_CREATE_TABLE,
"In InnoDB, charset-collation codes"
" must be below 256."
" Unsupported code %lu.",
(ulong) charset_no);
DBUG_RETURN(ER_CANT_CREATE_TABLE);
}
} }
ut_a(field->type() < 256); /* we assume in dtype_form_prtype() ut_a(field->type() < 256); /* we assume in dtype_form_prtype()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment