1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0

into moonbone.local:/work/17530-bug-5.0-mysql
This commit is contained in:
evgen@moonbone.local
2006-02-24 14:29:41 +03:00
3 changed files with 17 additions and 1 deletions

View File

@@ -765,3 +765,9 @@ t1 CREATE TABLE `t1` (
`i` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 MAX_ROWS=4294967295
drop table t1;
create table t1(f1 varchar(800) binary not null, key(f1)) engine = innodb
character set utf8 collate utf8_general_ci;
Warnings:
Warning 1071 Specified key was too long; max key length is 765 bytes
insert into t1 values('aaa');
drop table t1;

View File

@@ -660,4 +660,12 @@ alter table t1 max_rows=100000000000;
show create table t1;
drop table t1;
#
# Bug#17530: Incorrect key truncation on table creation caused server crash.
#
create table t1(f1 varchar(800) binary not null, key(f1)) engine = innodb
character set utf8 collate utf8_general_ci;
insert into t1 values('aaa');
drop table t1;
# End of 5.0 tests

View File

@@ -1299,7 +1299,9 @@ static int mysql_prepare_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();
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 */