MDEV-26198 Assertion `0' failed in row_log_table_apply_op during

		redundant table rebuild

- InnoDB alter fails to apply the online log during redundant table
rebuild. Problem is that InnoDB wrongly reads the length flags of the
record while applying the temporary log record.

rec_init_offsets_comp_ordinary(): For finding the n_core_null_bytes,
InnoDB should use the same logic as rec_convert_dtuple_to_rec_comp().
parent 8b37e79a
......@@ -181,3 +181,27 @@ t3 CREATE TABLE `t3` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP TABLE t1,t2,t3;
db.opt
#
# MDEV-26198 Assertion `0' failed in row_log_table_apply_op during
# ADD PRIMARY KEY or OPTIMIZE TABLE
#
CREATE TABLE t1(f1 year default null, f2 year default null,
f3 text, f4 year default null, f5 year default null,
f6 year default null, f7 year default null,
f8 year default null)ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
INSERT INTO t1 VALUES(1, 1, 1, 1, 1, 1, 1, 1);
ALTER TABLE t1 ADD COLUMN f9 year default null, ALGORITHM=INPLACE;
set DEBUG_SYNC="row_log_table_apply1_before SIGNAL con1_insert WAIT_FOR con1_finish";
ALTER TABLE t1 ROW_FORMAT=REDUNDANT, ADD COLUMN f10 YEAR DEFAULT NULL, ALGORITHM=INPLACE;
connect con1,localhost,root,,,;
SET DEBUG_SYNC="now WAIT_FOR con1_insert";
INSERT IGNORE INTO t1 (f3) VALUES ( 'b' );
INSERT IGNORE INTO t1 (f3) VALUES ( 'l' );
SET DEBUG_SYNC="now SIGNAL con1_finish";
connection default;
disconnect con1;
SET DEBUG_SYNC=RESET;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
......@@ -205,3 +205,29 @@ DROP TABLE t1,t2,t3;
--remove_files_wildcard $MYSQLD_DATADIR/test #sql*.frm
--list_files $MYSQLD_DATADIR/test
--echo #
--echo # MDEV-26198 Assertion `0' failed in row_log_table_apply_op during
--echo # ADD PRIMARY KEY or OPTIMIZE TABLE
--echo #
CREATE TABLE t1(f1 year default null, f2 year default null,
f3 text, f4 year default null, f5 year default null,
f6 year default null, f7 year default null,
f8 year default null)ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
INSERT INTO t1 VALUES(1, 1, 1, 1, 1, 1, 1, 1);
ALTER TABLE t1 ADD COLUMN f9 year default null, ALGORITHM=INPLACE;
set DEBUG_SYNC="row_log_table_apply1_before SIGNAL con1_insert WAIT_FOR con1_finish";
send ALTER TABLE t1 ROW_FORMAT=REDUNDANT, ADD COLUMN f10 YEAR DEFAULT NULL, ALGORITHM=INPLACE;
connect(con1,localhost,root,,,);
SET DEBUG_SYNC="now WAIT_FOR con1_insert";
INSERT IGNORE INTO t1 (f3) VALUES ( 'b' );
INSERT IGNORE INTO t1 (f3) VALUES ( 'l' );
SET DEBUG_SYNC="now SIGNAL con1_finish";
connection default;
reap;
disconnect con1;
SET DEBUG_SYNC=RESET;
CHECK TABLE t1;
DROP TABLE t1;
......@@ -287,7 +287,9 @@ rec_init_offsets_comp_ordinary(
!= n_core)
? UT_BITS_IN_BYTES(unsigned(index->get_n_nullable(n_core)))
: (redundant_temp
? UT_BITS_IN_BYTES(index->n_nullable)
? (index->is_instant()
? UT_BITS_IN_BYTES(index->get_n_nullable(n_core))
: UT_BITS_IN_BYTES(index->n_nullable))
: index->n_core_null_bytes);
if (mblob) {
......
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