mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-24730 Insert log operation fails after purge resets n_core_fields
Online log for insert operation of redundant table fails with index->is_instant() assert. Purge can reset the n_core_fields when alter is waiting to upgrade MDL for commit phase of DDL. In the meantime, any insert DML tries to log the operation fails with index is not being instant. row_log_get_n_core_fields(): Get the n_core_fields of online log for the given index. rec_get_converted_size_comp_prefix_low(): Use n_core_fields of online log when InnoDB calculates the size of data tuple during redundant row format table rebuild. rec_convert_dtuple_to_rec_comp(): Use n_core_fields of online log when InnoDB does the conversion of data tuple to record during redudant row format table rebuild. - Adding the test case which has more than 129 instant columns.
This commit is contained in:
@ -190,6 +190,12 @@ SET DEBUG_SYNC='RESET';
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
INSERT INTO t1 SET a=0;
|
||||
ALTER TABLE t1 ADD COLUMN b INT NOT NULL DEFAULT 2, ADD COLUMN c INT;
|
||||
BEGIN NOT ATOMIC
|
||||
DECLARE c TEXT DEFAULT(SELECT CONCAT('ALTER TABLE t1 ADD (c',
|
||||
GROUP_CONCAT(seq SEPARATOR ' INT, c'), ' INT), ALGORITHM=INSTANT;') FROM seq_1_to_130);
|
||||
EXECUTE IMMEDIATE c;
|
||||
END;
|
||||
$$
|
||||
connection stop_purge;
|
||||
START TRANSACTION WITH CONSISTENT SNAPSHOT;
|
||||
connection default;
|
||||
@ -207,7 +213,7 @@ SET DEBUG_SYNC = 'now SIGNAL logged';
|
||||
connection ddl;
|
||||
connection default;
|
||||
SET DEBUG_SYNC = RESET;
|
||||
SELECT * FROM t1;
|
||||
SELECT a, b, c FROM t1;
|
||||
a b c
|
||||
1 2 NULL
|
||||
2 3 4
|
||||
@ -231,7 +237,7 @@ ERROR 22004: Invalid use of NULL value
|
||||
disconnect ddl;
|
||||
connection default;
|
||||
SET DEBUG_SYNC = RESET;
|
||||
SELECT * FROM t1;
|
||||
SELECT a, b, c, d FROM t1;
|
||||
a b c d
|
||||
1 2 NULL 1
|
||||
2 3 4 1
|
||||
|
Reference in New Issue
Block a user