summaryrefslogtreecommitdiff
path: root/mysql-test/t/innodb_bug46000.test
blob: 03942c86c98f3c36546071d48c6f6ed3687e85ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# 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.
--replace_regex /'[^']*test.#sql-[0-9a-f_]*'/'#sql-temporary'/
--error ER_WRONG_NAME_FOR_INDEX
create index GEN_CLUST_INDEX on bug46000(id);

--replace_regex /'[^']*test.#sql-[0-9a-f_]*'/'#sql-temporary'/
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;