Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion mysql-test/suite/innodb/r/sys_defragment_fail.result
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ INSERT INTO t1 SELECT seq, seq FROM seq_1_to_4096;
DROP TABLE t2;
InnoDB 0 transactions not purged
# restart
FOUND 1 /InnoDB: User table exists in the system tablespace/ in mysqld.1.err
FOUND 1 /InnoDB: Found unexpected table in system tablespace \(space=0\): test\/t1/ in mysqld.1.err
FOUND 1 /InnoDB: Unexpected table exists in the system tablespace/ in mysqld.1.err
DROP TABLE t1;
InnoDB 0 transactions not purged
# restart: --debug_dbug=+d,fail_after_level_defragment
Expand Down
4 changes: 3 additions & 1 deletion mysql-test/suite/innodb/t/sys_defragment_fail.test
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ let $restart_parameters=;
--source include/restart_mysqld.inc

let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
let SEARCH_PATTERN=InnoDB: User table exists in the system tablespace;
let SEARCH_PATTERN=InnoDB: Found unexpected table in system tablespace \(space=0\): test\/t1;
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN=InnoDB: Unexpected table exists in the system tablespace;
--source include/search_pattern_in_file.inc
DROP TABLE t1;

Expand Down
11 changes: 10 additions & 1 deletion storage/innobase/fsp/fsp0fsp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5723,6 +5723,15 @@ static dberr_t user_tables_exists() noexcept
goto corrupt;
if (!dict_sys.is_sys_table(mach_read_from_8(field)))
{
const byte *name_field = rec_get_nth_field_old(
rec, DICT_FLD__SYS_TABLES__NAME, &len);
if (len != UNIV_SQL_NULL && len > 0)
{
sql_print_information(
"InnoDB: Found unexpected table in system tablespace"
"(space=0): %.*s",
(int)len, (const char *)name_field);
}
err= DB_SUCCESS_LOCKED_REC;
btr_pcur_close(&pcur);
goto func_exit;
Expand All @@ -5740,7 +5749,7 @@ dberr_t fil_space_t::defragment() noexcept
if (err == DB_SUCCESS_LOCKED_REC)
{
sql_print_information(
"InnoDB: User table exists in the system tablespace."
"InnoDB: Unexpected table exists in the system tablespace."
"Please try to move the data from system tablespace "
"to separate tablespace before defragment the "
"system tablespace.");
Expand Down