Merge mysql.com:/home/ram/work/b28125/b28125.5.0

into  mysql.com:/home/ram/work/b28125/b28125.5.1
parents 216c669b 100faf97
...@@ -814,8 +814,16 @@ create table t1 (a int) engine=innodb; ...@@ -814,8 +814,16 @@ create table t1 (a int) engine=innodb;
alter table t1 alter a set default 1; alter table t1 alter a set default 1;
drop table t1; drop table t1;
--echo End of 5.0 tests #
# Bug #28125: ERROR 2013 when adding index.
#
create table t1(a text) engine=innodb default charset=utf8;
insert into t1 values('aaa');
alter table t1 add index(a(1024));
show create table t1;
drop table t1;
--echo End of 5.0 tests
# Fix for BUG#19243 "wrong LAST_INSERT_ID() after ON DUPLICATE KEY # Fix for BUG#19243 "wrong LAST_INSERT_ID() after ON DUPLICATE KEY
# UPDATE": if the row is updated, it's like a regular UPDATE: # UPDATE": if the row is updated, it's like a regular UPDATE:
...@@ -917,5 +925,4 @@ unlock tables; ...@@ -917,5 +925,4 @@ unlock tables;
select * from t1; select * from t1;
drop tables t1; drop tables t1;
--echo End of 5.1 tests --echo End of 5.1 tests
...@@ -2789,6 +2789,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, ...@@ -2789,6 +2789,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
length); length);
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TOO_LONG_KEY, warn_buff); ER_TOO_LONG_KEY, warn_buff);
/* Align key length to multibyte char boundary */
length-= length % sql_field->charset->mbmaxlen;
} }
else else
{ {
...@@ -2819,8 +2821,6 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, ...@@ -2819,8 +2821,6 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
if (length > file->max_key_part_length() && key->type != Key::FULLTEXT) if (length > file->max_key_part_length() && key->type != Key::FULLTEXT)
{ {
length= file->max_key_part_length(); length= file->max_key_part_length();
/* Align key length to multibyte char boundary */
length-= length % sql_field->charset->mbmaxlen;
if (key->type == Key::MULTIPLE) if (key->type == Key::MULTIPLE)
{ {
/* not a critical problem */ /* not a critical problem */
...@@ -2829,6 +2829,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, ...@@ -2829,6 +2829,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
length); length);
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TOO_LONG_KEY, warn_buff); ER_TOO_LONG_KEY, warn_buff);
/* Align key length to multibyte char boundary */
length-= length % sql_field->charset->mbmaxlen;
} }
else else
{ {
......
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