summaryrefslogtreecommitdiff
path: root/mysql-test/t/create.test
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2006-02-21 18:09:32 +0300
committerunknown <evgen@moonbone.local>2006-02-21 18:09:32 +0300
commit71ee8615c34db5299d51bc440309371ea08b5923 (patch)
treeae74b5f230c89a5d2c3fff3b419026ac31881893 /mysql-test/t/create.test
parent387ae4abcf2d484aebe9eae6edcab81c8c9556f9 (diff)
downloadmariadb-git-71ee8615c34db5299d51bc440309371ea08b5923.tar.gz
Fixed bug#17530: Incorrect key truncation on table creation caused server crash.
When a too long field is used for a key, only a prefix part of the field is used. Length is reduced to the max key length allowed for storage. But if the field have a multibyte charset it is possible to break multibyte char sequence. This leads to the failed assertion in the innodb code and server crash when a record is inserted. The make_prepare_table() now aligns truncated key length to the boundary of multibyte char. mysql-test/t/create.test: Added test case for bug#17530: Incorrect key truncation on table creation caused server crash. mysql-test/r/create.result: Added test case for bug#17530: Incorrect key truncation on table creation caused server crash. sql/sql_table.cc: Fixed bug#17530: Incorrect key truncation on table creation caused server crash. The make_prepare_table() now aligns truncated key length to the boundary of multibyte char.
Diffstat (limited to 'mysql-test/t/create.test')
-rw-r--r--mysql-test/t/create.test8
1 files changed, 8 insertions, 0 deletions
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index f7b9002faa0..9fcbb53e24d 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -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