mariadb/mysql-test/innodb_bug46000.test
jyang 396f34227c branches/zip: Port bug #46000 related changes from 5.1 to zip
branch. Due to different code path for creating index in zip
branch comparing to 5.1), the index reserved name check function
is extended to be used in ha_innobase::add_index(). 
rb://190  Approved by: Marko
2009-10-22 01:58:39 +00:00

32 lines
941 B
Text

# This is the test for bug 46000. We shall
# block any index creation with the name of
# "GEN_CLUST_INDEX", which is the reserved
# name for innodb default primary index.
--source include/have_innodb.inc
# This 'create table' operation should fail because of
# using the reserve name as its index name.
--error ER_WRONG_NAME_FOR_INDEX
create table bug46000(`id` int,key `GEN_CLUST_INDEX`(`id`))engine=innodb;
# Mixed upper/lower case of the reserved key words
--error ER_WRONG_NAME_FOR_INDEX
create table bug46000(`id` int, key `GEN_clust_INDEX`(`id`))engine=innodb;
show warnings;
create table bug46000(id int) engine=innodb;
# This 'create index' operation should fail.
--error ER_WRONG_NAME_FOR_INDEX
create index GEN_CLUST_INDEX on bug46000(id);
show warnings;
# This 'create index' operation should succeed, no
# temp table left from last failed create index
# operation.
create index idx on bug46000(id);
drop table bug46000;