Commit 501f38bc authored by unknown's avatar unknown

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

into  mysql.com:/home/ram/work/b28125/b28125.5.1


sql/sql_table.cc:
  Auto merged
mysql-test/include/mix1.inc:
  manual merge
parents 1da15614 26001a27
......@@ -814,8 +814,16 @@ create table t1 (a int) engine=innodb;
alter table t1 alter a set default 1;
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
# UPDATE": if the row is updated, it's like a regular UPDATE:
......@@ -917,5 +925,4 @@ unlock tables;
select * from t1;
drop tables t1;
--echo End of 5.1 tests
......@@ -2789,6 +2789,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
length);
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TOO_LONG_KEY, warn_buff);
/* Align key length to multibyte char boundary */
length-= length % sql_field->charset->mbmaxlen;
}
else
{
......@@ -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)
{
length= file->max_key_part_length();
/* Align key length to multibyte char boundary */
length-= length % sql_field->charset->mbmaxlen;
if (key->type == Key::MULTIPLE)
{
/* not a critical problem */
......@@ -2829,6 +2829,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
length);
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TOO_LONG_KEY, warn_buff);
/* Align key length to multibyte char boundary */
length-= length % sql_field->charset->mbmaxlen;
}
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