Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
e39ff6b0
Commit
e39ff6b0
authored
Sep 04, 2009
by
jyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
branches/5.1: Revert change in 5740. Making the fix in a subsequent
check in.
parent
e4d73324
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1 addition
and
81 deletions
+1
-81
handler/ha_innodb.cc
handler/ha_innodb.cc
+1
-24
include/db0err.h
include/db0err.h
+0
-3
mysql-test/innodb_bug46000.result
mysql-test/innodb_bug46000.result
+0
-18
mysql-test/innodb_bug46000.test
mysql-test/innodb_bug46000.test
+0
-36
No files found.
handler/ha_innodb.cc
View file @
e39ff6b0
...
...
@@ -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
);
...
...
include/db0err.h
View file @
e39ff6b0
...
...
@@ -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
...
...
mysql-test/innodb_bug46000.result
deleted
100644 → 0
View file @
e4d73324
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;
mysql-test/innodb_bug46000.test
deleted
100644 → 0
View file @
e4d73324
# 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
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment