From e39ff6b07a394fc655469d41cc9da6b3718313b6 Mon Sep 17 00:00:00 2001 From: jyang Date: Fri, 4 Sep 2009 00:26:13 +0000 Subject: [PATCH] branches/5.1: Revert change in 5740. Making the fix in a subsequent check in. --- handler/ha_innodb.cc | 25 +-------------------- include/db0err.h | 3 --- mysql-test/innodb_bug46000.result | 18 ---------------- mysql-test/innodb_bug46000.test | 36 ------------------------------- 4 files changed, 1 insertion(+), 81 deletions(-) delete mode 100644 mysql-test/innodb_bug46000.result delete mode 100644 mysql-test/innodb_bug46000.test diff --git a/handler/ha_innodb.cc b/handler/ha_innodb.cc index b8e5645102b..b9ac8f6a4a6 100644 --- a/handler/ha_innodb.cc +++ b/handler/ha_innodb.cc @@ -165,7 +165,6 @@ static handler *innobase_create_handler(handlerton *hton, MEM_ROOT *mem_root); static const char innobase_hton_name[]= "InnoDB"; -static const char innobase_idx_reserve_name[]= "GEN_CLUST_INDEX"; /** @brief Initialize the default value of innodb_commit_concurrency. @@ -5136,22 +5135,6 @@ create_index( n_fields = key->key_parts; - /* Do not allow creating index with the name of "GEN_CLUST_INDEX", - which is the name reserved for default primary index created by - innodb. Innodb does not support indices with duplicated name. */ - if (innobase_strcasecmp(key->name, innobase_idx_reserve_name) == 0) { - push_warning_printf( - (THD *)trx->mysql_thd, - MYSQL_ERROR::WARN_LEVEL_ERROR, - ER_CANT_CREATE_TABLE, - "Cannot Create Index with name " - "'%s'. The name is reserved " - "for the system default primary index.", - innobase_idx_reserve_name); - - DBUG_RETURN(DB_RESERVED_NAME); - } - ind_type = 0; if (key_num == form->s->primary_key) { @@ -5265,7 +5248,7 @@ create_clustered_index_when_no_primary( /* We pass 0 as the space id, and determine at a lower level the space id where to store the table */ - index = dict_mem_index_create(table_name, innobase_idx_reserve_name, + index = dict_mem_index_create(table_name, "GEN_CLUST_INDEX", 0, DICT_CLUSTERED, 0); error = row_create_index_for_mysql(index, trx, NULL); @@ -5510,12 +5493,6 @@ ha_innobase::create( DBUG_RETURN(0); cleanup: - /* Fail to create index with name conflicting with system - reserved names. Drop the (temp) table before return. */ - if (error == DB_RESERVED_NAME) { - row_drop_table_for_mysql(norm_name, trx, 0); - } - innobase_commit_low(trx); row_mysql_unlock_data_dictionary(trx); diff --git a/include/db0err.h b/include/db0err.h index c13c7394a2e..ed7ce151718 100644 --- a/include/db0err.h +++ b/include/db0err.h @@ -69,9 +69,6 @@ Created 5/24/1996 Heikki Tuuri a feature that it can't recoginize or work with e.g., FT indexes created by a later version of the engine. */ -#define DB_RESERVED_NAME 49 /* Name used is conflicting with an - internal System Reserved Name. */ - /* The following are partial failure codes */ #define DB_FAIL 1000 #define DB_OVERFLOW 1001 diff --git a/mysql-test/innodb_bug46000.result b/mysql-test/innodb_bug46000.result deleted file mode 100644 index 22cd75b88af..00000000000 --- a/mysql-test/innodb_bug46000.result +++ /dev/null @@ -1,18 +0,0 @@ -SET storage_engine=InnoDB; -create table bug46000(`id` int,key `GEN_CLUST_INDEX`(`id`))engine=innodb; -ERROR HY000: Can't create table 'test.bug46000' (errno: 49) -create table bug46000(`id` int,key `GEN_clust_INDEX`(`id`))engine=innodb; -ERROR HY000: Can't create table 'test.bug46000' (errno: 49) -show errors; -Level Code Message -Error 1005 Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for system default primary index. -Error 1005 Can't create table 'test.bug46000' (errno: 49) -create table bug46000(id int) engine = innodb; -create index GEN_CLUST_INDEX on bug46000(id); -ERROR HY000: Can't create table '#sql-temporary' (errno: 49) -show errors; -Level Code Message -Error 1005 Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for system default primary index. -Error 1005 Can't create table 'test.#sql-2cb4_2' (errno: 49) -create index idx on bug46000(id); -drop table bug46000; diff --git a/mysql-test/innodb_bug46000.test b/mysql-test/innodb_bug46000.test deleted file mode 100644 index aa66222d95c..00000000000 --- a/mysql-test/innodb_bug46000.test +++ /dev/null @@ -1,36 +0,0 @@ -# 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 - -SET storage_engine=InnoDB; - - -# 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); - -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;