summaryrefslogtreecommitdiff
path: root/storage/xtradb/handler
diff options
context:
space:
mode:
Diffstat (limited to 'storage/xtradb/handler')
-rw-r--r--storage/xtradb/handler/ha_innodb.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index 0834f4d08b1..0f5952ce5f2 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -4271,7 +4271,7 @@ Normalizes a table name string. A normalized name consists of the
database name catenated to '/' and table name. An example:
test/mytable. On Windows normalization puts both the database name and the
table name always to lower case if "set_lower_case" is set to TRUE. */
-static
+extern "C" UNIV_INTERN
void
normalize_table_name_low(
/*=====================*/
@@ -8805,7 +8805,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*) trx->mysql_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TABLE_NAME,
@@ -8814,6 +8815,15 @@ create_table_def(
DBUG_RETURN(ER_TABLE_NAME);
}
+ if (table_name[table_name_len - 1] == '/') {
+ push_warning_printf(
+ (THD*) trx->mysql_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_TABLE_NAME,
+ "InnoDB: Table name is empty");
+
+ DBUG_RETURN(ER_WRONG_TABLE_NAME);
+ }
+
n_cols = form->s->fields;
/* We pass 0 as the space id, and determine at a lower level the space