Browse Source
Applying InnoDB snapshot 5.1-ss5921, Part 1. Fixes BUG#46000
Applying InnoDB snapshot 5.1-ss5921, Part 1. Fixes BUG#46000
1. BUG#46000 - using index called GEN_CLUST_INDEX crashes server Detailed revision comments: r5895 | jyang | 2009-09-15 03:39:21 +0300 (Tue, 15 Sep 2009) | 5 lines branches/5.1: Disallow creating index with the name of "GEN_CLUST_INDEX" which is reserved for the default system primary index. (Bug #46000) rb://149 approved by Marko Makela.pull/374/head
4 changed files with 135 additions and 12 deletions
-
2mysql-test/lib/mtr_cases.pm
-
17mysql-test/r/innodb_bug46000.result
-
34mysql-test/t/innodb_bug46000.test
-
94storage/innobase/handler/ha_innodb.cc
@ -0,0 +1,17 @@ |
|||
create table bug46000(`id` int,key `GEN_CLUST_INDEX`(`id`))engine=innodb; |
|||
ERROR HY000: Can't create table 'test.bug46000' (errno: -1) |
|||
create table bug46000(`id` int, key `GEN_clust_INDEX`(`id`))engine=innodb; |
|||
ERROR HY000: Can't create table 'test.bug46000' (errno: -1) |
|||
show errors; |
|||
Level Code Message |
|||
Error 1005 Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for the system default primary index. |
|||
Error 1005 Can't create table 'test.bug46000' (errno: -1) |
|||
create table bug46000(id int) engine=innodb; |
|||
create index GEN_CLUST_INDEX on bug46000(id); |
|||
ERROR HY000: Can't create table '#sql-temporary' (errno: -1) |
|||
show errors; |
|||
Level Code Message |
|||
Error 1005 Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for the system default primary index. |
|||
Error 1005 Can't create table '#sql-temporary' (errno: -1) |
|||
create index idx on bug46000(id); |
|||
drop table bug46000; |
|||
@ -0,0 +1,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_CANT_CREATE_TABLE |
|||
create table bug46000(`id` int,key `GEN_CLUST_INDEX`(`id`))engine=innodb; |
|||
|
|||
# Mixed upper/lower case of the reserved key words |
|||
--error ER_CANT_CREATE_TABLE |
|||
create table bug46000(`id` int, key `GEN_clust_INDEX`(`id`))engine=innodb; |
|||
|
|||
show errors; |
|||
|
|||
create table bug46000(id int) engine=innodb; |
|||
|
|||
# This 'create index' operation should fail. |
|||
--replace_regex /'[^']*test.#sql-[0-9a-f_]*'/'#sql-temporary'/ |
|||
--error ER_CANT_CREATE_TABLE |
|||
create index GEN_CLUST_INDEX on bug46000(id); |
|||
|
|||
--replace_regex /'[^']*test.#sql-[0-9a-f_]*'/'#sql-temporary'/ |
|||
show errors; |
|||
|
|||
# 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; |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue