MDEV-30870 Undo tablespace name displays wrongly for I_S queries

- INNODB_SYS_TABLESPACES in information schema should display
innodb_undo001, innodb_undo002 etc as tablespace name for undo
tablespaces
parent 18e4978e
SET GLOBAL innodb_undo_log_truncate = 0; SET GLOBAL innodb_undo_log_truncate = 0;
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1; SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
Space_Name Page_Size Zip_Size Path
innodb_undo001 DEFAULT DEFAULT MYSQLD_DATADIR//undo001
innodb_undo002 DEFAULT DEFAULT MYSQLD_DATADIR//undo002
innodb_temporary DEFAULT DEFAULT MYSQLD_DATADIR/ibtmp1
create table t1(keyc int primary key, c char(100)) engine = innodb; create table t1(keyc int primary key, c char(100)) engine = innodb;
create table t2(keyc int primary key, c char(100)) engine = innodb; create table t2(keyc int primary key, c char(100)) engine = innodb;
connect con1,localhost,root,,; connect con1,localhost,root,,;
......
--innodb-buffer-pool-size=24M --innodb-buffer-pool-size=24M
--innodb-immediate-scrub-data-uncompressed=ON --innodb-immediate-scrub-data-uncompressed=ON
--loose-innodb-sys-tablespaces
...@@ -15,6 +15,9 @@ call mtr.add_suppression("InnoDB: Trying to delete tablespace.*pending operation ...@@ -15,6 +15,9 @@ call mtr.add_suppression("InnoDB: Trying to delete tablespace.*pending operation
SET GLOBAL innodb_undo_log_truncate = 0; SET GLOBAL innodb_undo_log_truncate = 0;
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1; SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
LET $MYSQLD_DATADIR = `select @@datadir`;
LET $INNODB_PAGE_SIZE = `select @@innodb_page_size`;
--source suite/innodb/include/show_i_s_tablespaces.inc
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# #
# Perform DML action using multiple clients and multiple undo tablespace. # Perform DML action using multiple clients and multiple undo tablespace.
......
...@@ -6436,8 +6436,13 @@ static int i_s_sys_tablespaces_fill(THD *thd, const fil_space_t &s, TABLE *t) ...@@ -6436,8 +6436,13 @@ static int i_s_sys_tablespaces_fill(THD *thd, const fil_space_t &s, TABLE *t)
OK(f->store(name.data(), name.size(), system_charset_info)); OK(f->store(name.data(), name.size(), system_charset_info));
f->set_notnull(); f->set_notnull();
} }
else else if (srv_is_undo_tablespace(s.id))
f->set_notnull(); {
char name[15];
snprintf(name, sizeof name, "innodb_undo%03zu",
(s.id - srv_undo_space_id_start + 1));
OK(f->store(name, strlen(name), system_charset_info));
} else f->set_notnull();
} }
fields[SYS_TABLESPACES_NAME]->set_null(); fields[SYS_TABLESPACES_NAME]->set_null();
......
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