Commit d5787a3c authored by Vasil Dimov's avatar Vasil Dimov

Fix Bug#57739 Scary messages in error log

Silence a warning about old table name when InnoDB tests whether the
format has changed using a nonexistent table name.

Reviewed by:	bar@mysql.com, marko.makela@oracle.com
parent 250d8511
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
class THD; 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); int get_quote_char_for_identifier(THD *thd, const char *name, uint length);
bool schema_table_store_record(THD *thd, TABLE *table); bool schema_table_store_record(THD *thd, TABLE *table);
void localtime_to_TIME(MYSQL_TIME *to, struct tm *from); void localtime_to_TIME(MYSQL_TIME *to, struct tm *from);
......
...@@ -371,7 +371,11 @@ uint explain_filename(THD* thd, ...@@ -371,7 +371,11 @@ uint explain_filename(THD* thd,
Table name length. 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; uint errors;
size_t res; size_t res;
...@@ -391,7 +395,13 @@ uint filename_to_tablename(const char *from, char *to, uint to_length) ...@@ -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) - res= (strxnmov(to, to_length, MYSQL50_TABLE_NAME_PREFIX, from, NullS) -
to); 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, TODO: add a stored procedure for fix table and database names,
and mention its name in error log. and mention its name in error log.
......
...@@ -123,7 +123,11 @@ enum enum_explain_filename_mode ...@@ -123,7 +123,11 @@ enum enum_explain_filename_mode
#define NO_FRM_RENAME (1 << 2) #define NO_FRM_RENAME (1 << 2)
#define FRM_ONLY (1 << 3) #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 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); uint check_n_cut_mysql50_prefix(const char *from, char *to, uint to_length);
bool check_mysql50_prefix(const char *name); bool check_mysql50_prefix(const char *name);
......
...@@ -2164,13 +2164,13 @@ innobase_init( ...@@ -2164,13 +2164,13 @@ innobase_init(
ut_a(DATA_MYSQL_TRUE_VARCHAR == (ulint)MYSQL_TYPE_VARCHAR); ut_a(DATA_MYSQL_TRUE_VARCHAR == (ulint)MYSQL_TYPE_VARCHAR);
#ifdef UNIV_DEBUG #ifndef DBUG_OFF
static const char test_filename[] = "-@"; static const char test_filename[] = "-@";
char test_tablename[sizeof test_filename char test_tablename[sizeof test_filename
+ sizeof srv_mysql50_table_name_prefix]; + sizeof srv_mysql50_table_name_prefix];
if ((sizeof test_tablename) - 1 if ((sizeof test_tablename) - 1
!= filename_to_tablename(test_filename, test_tablename, != filename_to_tablename(test_filename, test_tablename,
sizeof test_tablename) sizeof test_tablename, true)
|| strncmp(test_tablename, || strncmp(test_tablename,
srv_mysql50_table_name_prefix, srv_mysql50_table_name_prefix,
sizeof srv_mysql50_table_name_prefix) sizeof srv_mysql50_table_name_prefix)
...@@ -2180,7 +2180,7 @@ innobase_init( ...@@ -2180,7 +2180,7 @@ innobase_init(
sql_print_error("tablename encoding has been changed"); sql_print_error("tablename encoding has been changed");
goto error; goto error;
} }
#endif /* UNIV_DEBUG */ #endif /* DBUG_OFF */
/* Check that values don't overflow on 32-bit systems. */ /* Check that values don't overflow on 32-bit systems. */
if (sizeof(ulint) == 4) { if (sizeof(ulint) == 4) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment