Permalink
Browse files

Bug #19929435 DROP DATABASE HANGS WITH MALFORMED TABLE

Problem:

A CREATE TABLE with an invalid table name is detected
at SQL layer. So the table name is reset to an empty
string.  But the storage engine is called with this
empty table name.  The table name is specified as
"database/table".  So, in the given scenario we get
only "database/".

Solution:

Within InnoDB, detect this error and report it to
higher layer.

rb#9274 approved by Jimmy.
  • Loading branch information...
gurusami committed Jun 13, 2015
1 parent a53568f commit 8fd710e06024a890e08e35009da541194ca0e5a4
@@ -0,0 +1,8 @@
#
# Bug #19929435 DROP DATABASE HANGS WITH MALFORMED TABLE
#
create database `b`;
use `b`;
create table `#mysql50#q.q` select 1;
ERROR HY000: Got error 1103 from storage engine
drop database `b`;
@@ -0,0 +1,11 @@
--source include/have_innodb.inc
--echo #
--echo # Bug #19929435 DROP DATABASE HANGS WITH MALFORMED TABLE
--echo #
create database `b`;
use `b`;
--error ER_GET_ERRNO
create table `#mysql50#q.q` select 1;
drop database `b`;
@@ -8506,7 +8506,8 @@ create_table_def(
/* MySQL does the name length check. But we do additional check
on the name length here */
if (strlen(table_name) > MAX_FULL_NAME_LEN) {
const size_t table_name_len = strlen(table_name);
if (table_name_len > MAX_FULL_NAME_LEN) {
push_warning_printf(
thd, Sql_condition::WARN_LEVEL_WARN,
ER_TABLE_NAME,
@@ -8515,6 +8516,15 @@ create_table_def(
DBUG_RETURN(ER_TABLE_NAME);
}
if (table_name[table_name_len - 1] == '/') {
push_warning_printf(
thd, Sql_condition::WARN_LEVEL_WARN,
ER_TABLE_NAME,
"InnoDB: Table name is empty");
DBUG_RETURN(ER_WRONG_TABLE_NAME);
}
n_cols = form->s->fields;
/* Check whether there already exists a FTS_DOC_ID column */

0 comments on commit 8fd710e

Please sign in to comment.