mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
MDEV-28919 Assertion `(((core_null) + 7) >> 3) == oindex.n_core_null_bytes || !not_redundant()' failed
- In case of discarded tablespace, InnoDB can't read the root page to assign the n_core_null_bytes. Consecutive instant DDL fails because of non-matching n_core_null_bytes.
This commit is contained in:
parent
d89cac0884
commit
99de8cc028
3 changed files with 59 additions and 0 deletions
|
@ -127,3 +127,29 @@ UNLOCK TABLES;
|
|||
ALTER TABLE t2 IMPORT TABLESPACE;
|
||||
ERROR HY000: Index for table 't2' is corrupt; try to repair it
|
||||
DROP TABLE t1, t2;
|
||||
#
|
||||
# MDEV-28919 Assertion `(((core_null) + 7) >> 3) ==
|
||||
# oindex.n_core_null_bytes || !not_redundant()' failed
|
||||
#
|
||||
call mtr.add_suppression(" InnoDB: Tablespace for table `test`.`t` is set as discarded");
|
||||
CREATE TABLE t (a INTEGER, b INTEGER as (a) VIRTUAL,
|
||||
c INTEGER)engine=innodb;
|
||||
ALTER TABLE t DISCARD TABLESPACE;
|
||||
ALTER TABLE t DROP COLUMN b, algorithm=instant;
|
||||
Warnings:
|
||||
Warning 1814 Tablespace has been discarded for table `t`
|
||||
ALTER TABLE t DROP COLUMN c, algorithm=instant;
|
||||
Warnings:
|
||||
Warning 1814 Tablespace has been discarded for table `t`
|
||||
CREATE TABLE t1(a INTEGER)ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(1);
|
||||
FLUSH TABLE t1 FOR EXPORT;
|
||||
unlock tables;
|
||||
ALTER TABLE t IMPORT tablespace;
|
||||
check table t;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t check status OK
|
||||
select * from t;
|
||||
a
|
||||
1
|
||||
DROP TABLE t, t1;
|
||||
|
|
|
@ -203,3 +203,27 @@ UNLOCK TABLES;
|
|||
ALTER TABLE t2 IMPORT TABLESPACE;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-28919 Assertion `(((core_null) + 7) >> 3) ==
|
||||
--echo # oindex.n_core_null_bytes || !not_redundant()' failed
|
||||
--echo #
|
||||
call mtr.add_suppression(" InnoDB: Tablespace for table `test`.`t` is set as discarded");
|
||||
CREATE TABLE t (a INTEGER, b INTEGER as (a) VIRTUAL,
|
||||
c INTEGER)engine=innodb;
|
||||
ALTER TABLE t DISCARD TABLESPACE;
|
||||
# Table does reload
|
||||
ALTER TABLE t DROP COLUMN b, algorithm=instant;
|
||||
ALTER TABLE t DROP COLUMN c, algorithm=instant;
|
||||
|
||||
CREATE TABLE t1(a INTEGER)ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(1);
|
||||
FLUSH TABLE t1 FOR EXPORT;
|
||||
--let $MYSQLD_DATADIR= `select @@datadir`
|
||||
--move_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t.cfg
|
||||
--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t.ibd
|
||||
unlock tables;
|
||||
ALTER TABLE t IMPORT tablespace;
|
||||
check table t;
|
||||
select * from t;
|
||||
DROP TABLE t, t1;
|
||||
|
|
|
@ -403,6 +403,15 @@ found_j:
|
|||
goto found_nullable;
|
||||
}
|
||||
}
|
||||
|
||||
/* In case of discarded tablespace, InnoDB can't
|
||||
read the root page. So assign the null bytes based
|
||||
on nullabled fields */
|
||||
if (!oindex.table->space) {
|
||||
oindex.n_core_null_bytes= UT_BITS_IN_BYTES(
|
||||
unsigned(oindex.n_nullable));
|
||||
}
|
||||
|
||||
/* The n_core_null_bytes only matters for
|
||||
ROW_FORMAT=COMPACT and ROW_FORMAT=DYNAMIC tables. */
|
||||
ut_ad(UT_BITS_IN_BYTES(core_null) == oindex.n_core_null_bytes
|
||||
|
|
Loading…
Reference in a new issue