1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-30615 Can't read from I_S.INNODB_SYS_INDEXES when having a discarded tablesace

- MY_I_S_MAYBE_NULL field attributes is added PAGE_NO and SPACE in
innodb_sys_index table. By doing this, InnoDB can set null for these
fields when it encounters discarded tablespace
This commit is contained in:
Thirunarayanan Balathandayuthapani
2023-02-15 01:18:26 +05:30
parent 2e6872791a
commit 702d1af32c
3 changed files with 26 additions and 3 deletions

View File

@ -173,6 +173,17 @@ UNLOCK TABLES;
SET GLOBAL innodb_compression_algorithm=0;
ALTER TABLE t1 FORCE;
ALTER TABLE t1 DISCARD TABLESPACE;
# Display the discarded table name by using SPACE and PAGE_NO
# column in INNODB_SYS_INDEXES and discard doesn't affect the
# SPACE in INNODB_SYS_TABLES
SELECT t.NAME, t.SPACE BETWEEN 1 and 0xFFFFFFEF as SYS_TABLE_SPACE_RANGE
FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES t
WHERE t.TABLE_ID IN (
SELECT i.TABLE_ID FROM
INFORMATION_SCHEMA.INNODB_SYS_INDEXES i WHERE
i.PAGE_NO IS NULL and i.SPACE IS NULL);
NAME SYS_TABLE_SPACE_RANGE
test/t1 1
db.opt
t1.frm
restore: t1 .ibd and .cfg files

View File

@ -195,6 +195,16 @@ SET GLOBAL innodb_compression_algorithm=0;
ALTER TABLE t1 FORCE;
ALTER TABLE t1 DISCARD TABLESPACE;
--echo # Display the discarded table name by using SPACE and PAGE_NO
--echo # column in INNODB_SYS_INDEXES and discard doesn't affect the
--echo # SPACE in INNODB_SYS_TABLES
SELECT t.NAME, t.SPACE BETWEEN 1 and 0xFFFFFFEF as SYS_TABLE_SPACE_RANGE
FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES t
WHERE t.TABLE_ID IN (
SELECT i.TABLE_ID FROM
INFORMATION_SCHEMA.INNODB_SYS_INDEXES i WHERE
i.PAGE_NO IS NULL and i.SPACE IS NULL);
--list_files $MYSQLD_DATADIR/test
perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";