diff options
-rw-r--r-- | include/mysql/innodb_priv.h | 1 | ||||
-rw-r--r-- | sql/sql_table.cc | 14 | ||||
-rw-r--r-- | sql/sql_table.h | 6 | ||||
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 6 |
4 files changed, 20 insertions, 7 deletions
diff --git a/include/mysql/innodb_priv.h b/include/mysql/innodb_priv.h index 993dad7cf99..5406c292b18 100644 --- a/include/mysql/innodb_priv.h +++ b/include/mysql/innodb_priv.h @@ -22,7 +22,6 @@ class THD; -uint filename_to_tablename(const char *from, char *to, uint to_length); int get_quote_char_for_identifier(THD *thd, const char *name, uint length); bool schema_table_store_record(THD *thd, TABLE *table); void localtime_to_TIME(MYSQL_TIME *to, struct tm *from); diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 772496a10d5..064c2b36e17 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -371,7 +371,11 @@ uint explain_filename(THD* thd, Table name length. */ -uint filename_to_tablename(const char *from, char *to, uint to_length) +uint filename_to_tablename(const char *from, char *to, uint to_length +#ifndef DBUG_OFF + , bool stay_quiet +#endif /* DBUG_OFF */ + ) { uint errors; size_t res; @@ -391,7 +395,13 @@ uint filename_to_tablename(const char *from, char *to, uint to_length) { res= (strxnmov(to, to_length, MYSQL50_TABLE_NAME_PREFIX, from, NullS) - to); - sql_print_error("Invalid (old?) table or database name '%s'", from); +#ifndef DBUG_OFF + if (!stay_quiet) { +#endif /* DBUG_OFF */ + sql_print_error("Invalid (old?) table or database name '%s'", from); +#ifndef DBUG_OFF + } +#endif /* DBUG_OFF */ /* TODO: add a stored procedure for fix table and database names, and mention its name in error log. diff --git a/sql/sql_table.h b/sql/sql_table.h index aa5738fd4c9..2924301e6b3 100644 --- a/sql/sql_table.h +++ b/sql/sql_table.h @@ -123,7 +123,11 @@ enum enum_explain_filename_mode #define NO_FRM_RENAME (1 << 2) #define FRM_ONLY (1 << 3) -uint filename_to_tablename(const char *from, char *to, uint to_length); +uint filename_to_tablename(const char *from, char *to, uint to_length +#ifndef DBUG_OFF + , bool stay_quiet = false +#endif /* DBUG_OFF */ + ); uint tablename_to_filename(const char *from, char *to, uint to_length); uint check_n_cut_mysql50_prefix(const char *from, char *to, uint to_length); bool check_mysql50_prefix(const char *name); diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index b0d620c060d..c9072b4c63e 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -2164,13 +2164,13 @@ innobase_init( ut_a(DATA_MYSQL_TRUE_VARCHAR == (ulint)MYSQL_TYPE_VARCHAR); -#ifdef UNIV_DEBUG +#ifndef DBUG_OFF static const char test_filename[] = "-@"; char test_tablename[sizeof test_filename + sizeof srv_mysql50_table_name_prefix]; if ((sizeof test_tablename) - 1 != filename_to_tablename(test_filename, test_tablename, - sizeof test_tablename) + sizeof test_tablename, true) || strncmp(test_tablename, srv_mysql50_table_name_prefix, sizeof srv_mysql50_table_name_prefix) @@ -2180,7 +2180,7 @@ innobase_init( sql_print_error("tablename encoding has been changed"); goto error; } -#endif /* UNIV_DEBUG */ +#endif /* DBUG_OFF */ /* Check that values don't overflow on 32-bit systems. */ if (sizeof(ulint) == 4) { |