Added test for bug #7884 "Able to add invalid unique index on TIMESTAMP

prefix", which roots were fixed in 4.0 tree.
parent 3d4eb575
...@@ -493,3 +493,7 @@ select hex(a) from t1; ...@@ -493,3 +493,7 @@ select hex(a) from t1;
hex(a) hex(a)
F2E5F1F2 F2E5F1F2
drop table t1; drop table t1;
create table t1 ( a timestamp );
alter table t1 add unique ( a(1) );
ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys
drop table t1;
...@@ -336,3 +336,14 @@ select hex(a) from t1; ...@@ -336,3 +336,14 @@ select hex(a) from t1;
alter table t1 convert to character set cp1251; alter table t1 convert to character set cp1251;
select hex(a) from t1; select hex(a) from t1;
drop table t1; drop table t1;
#
# Test for bug #7884 "Able to add invalid unique index on TIMESTAMP prefix"
# MySQL should not think that packed field with non-zero decimals is
# geometry field and allow to create prefix index which is
# shorter than packed field length.
#
create table t1 ( a timestamp );
--error 1089
alter table t1 add unique ( a(1) );
drop table t1;
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