mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
Added test for bug #7884 "Able to add invalid unique index on TIMESTAMP
prefix", which roots were fixed in 4.0 tree. mysql-test/r/alter_table.result: Added test for bug #7884 "Able to add invalid unique index on TIMESTAMP prefix". mysql-test/t/alter_table.test: Added test for bug #7884 "Able to add invalid unique index on TIMESTAMP prefix".
This commit is contained in:
@@ -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;
|
|||||||
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;
|
||||||
|
Reference in New Issue
Block a user