Skip to content
/ server Public

Commit 3009210

Browse files
jendisgkodinov
authored andcommitted
fsp0fsp.cc: log unexpected table in sys tablespace
Fix log message about unexpected table in system tablespace as the current message can be missleading due to still existing (but already deprecated) system tables SYS_DATAFILES and SYS_TABLESPACES, reported in - MDEV-38412 Also adding the informative message with table name of the unexpected table in system table space.
1 parent 93ef123 commit 3009210

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

mysql-test/suite/innodb/r/sys_defragment_fail.result

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ INSERT INTO t1 SELECT seq, seq FROM seq_1_to_4096;
1717
DROP TABLE t2;
1818
InnoDB 0 transactions not purged
1919
# restart
20-
FOUND 1 /InnoDB: User table exists in the system tablespace/ in mysqld.1.err
20+
FOUND 1 /InnoDB: Found unexpected table in system tablespace: test\/t1/ in mysqld.1.err
21+
FOUND 1 /InnoDB: Unexpected table exists in the system tablespace/ in mysqld.1.err
2122
DROP TABLE t1;
2223
InnoDB 0 transactions not purged
2324
# restart: --debug_dbug=+d,fail_after_level_defragment

mysql-test/suite/innodb/t/sys_defragment_fail.test

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ let $restart_parameters=;
2929
--source include/restart_mysqld.inc
3030

3131
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
32-
let SEARCH_PATTERN=InnoDB: User table exists in the system tablespace;
32+
let SEARCH_PATTERN=InnoDB: Found unexpected table in system tablespace: test\/t1;
33+
--source include/search_pattern_in_file.inc
34+
let SEARCH_PATTERN=InnoDB: Unexpected table exists in the system tablespace;
3335
--source include/search_pattern_in_file.inc
3436
DROP TABLE t1;
3537

storage/innobase/fsp/fsp0fsp.cc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5723,6 +5723,14 @@ static dberr_t user_tables_exists() noexcept
57235723
goto corrupt;
57245724
if (!dict_sys.is_sys_table(mach_read_from_8(field)))
57255725
{
5726+
const byte *name_field = rec_get_nth_field_old(
5727+
rec, DICT_FLD__SYS_TABLES__NAME, &len);
5728+
if (len != UNIV_SQL_NULL && len > 0)
5729+
{
5730+
sql_print_information(
5731+
"InnoDB: Found unexpected table in system tablespace: %.*s",
5732+
(int)len, (const char *)name_field);
5733+
}
57265734
err= DB_SUCCESS_LOCKED_REC;
57275735
btr_pcur_close(&pcur);
57285736
goto func_exit;
@@ -5740,7 +5748,7 @@ dberr_t fil_space_t::defragment() noexcept
57405748
if (err == DB_SUCCESS_LOCKED_REC)
57415749
{
57425750
sql_print_information(
5743-
"InnoDB: User table exists in the system tablespace."
5751+
"InnoDB: Unexpected table exists in the system tablespace."
57445752
"Please try to move the data from system tablespace "
57455753
"to separate tablespace before defragment the "
57465754
"system tablespace.");

0 commit comments

Comments
 (0)