mariadb/mysql-test/suite/gcol/r/gcol_rollback.result
Thirunarayanan Balathandayuthapani 81faf41786 MDEV-30597 Assertion `flag == 1' failed in row_build_index_entry_low
- InnoDB tries to build the previous version of the record for
the virtual index, but the undo log record doesn't contain
virtual column information. This leads to assert failure while
building the tuple.
2023-02-14 14:28:27 +05:30

107 lines
2.2 KiB
Text

CREATE TABLE t (
a INTEGER,
b BLOB GENERATED ALWAYS AS (a) VIRTUAL,
INDEX (b(57))
)ENGINE=INNODB;
INSERT INTO t (a) VALUES (9);
BEGIN;
SAVEPOINT a;
UPDATE t set a = 12;
DELETE FROM t where a = 12;
ROLLBACK TO SAVEPOINT a;
COMMIT;
CHECK TABLE t;
Table Op Msg_type Msg_text
test.t check status OK
SELECT * FROM t;
a b
9 9
BEGIN;
INSERT INTO t (a) VALUES (10);
# restart
SELECT * FROM t;
a b
9 9
DROP TABLE t;
CREATE TABLE t (
a INTEGER,
b BLOB GENERATED ALWAYS AS (a) VIRTUAL,
c INTEGER
)ENGINE=INNODB;
INSERT INTO t (a,c) VALUES (9, 10);
SELECT * FROM t;
a b c
9 9 10
connect con1,localhost,root,,;
connection con1;
SET DEBUG_SYNC = 'row_log_apply_after SIGNAL created WAIT_FOR dml_done';
ALTER TABLE t ADD KEY(b(57)), ALGORITHM=INPLACE;
connection default;
SET DEBUG_SYNC = 'now WAIT_FOR created';
BEGIN;
INSERT INTO t (a,c) VALUES (10, 12);
SELECT * FROM t;
a b c
9 9 10
10 10 12
ROLLBACK;
SET DEBUG_SYNC = 'now SIGNAL dml_done';
connection con1;
disconnect con1;
connection default;
SELECT * FROM t;
a b c
9 9 10
DROP TABLE t;
CREATE TABLE t (
a INT,
b INT,
c INT GENERATED ALWAYS AS(a+b),
d INT GENERATED ALWAYS AS(a+b+b),
KEY(c, d)
)ENGINE=INNODB;
INSERT INTO t (a,b) VALUES (9, 10);
SELECT * FROM t;
a b c d
9 10 19 29
connect con1,localhost,root,,;
connection con1;
SET DEBUG_SYNC = 'row_log_apply_after SIGNAL created WAIT_FOR dml_done';
ALTER TABLE t DROP COLUMN c, ALGORITHM=INPLACE;
connection default;
SET DEBUG_SYNC = 'now WAIT_FOR created';
BEGIN;
INSERT INTO t (a,b) VALUES (10, 12);
SELECT * FROM t;
a b c d
9 10 19 29
10 12 22 34
ROLLBACK;
SET DEBUG_SYNC = 'now SIGNAL dml_done';
connection con1;
connection default;
SELECT * FROM t;
a b d
9 10 29
DROP TABLE t;
SET DEBUG_SYNC = 'RESET';
#
# MDEV-30597 Assertion `flag == 1' failed in
# row_build_index_entry_low
#
CREATE TABLE t1 (
col1 INT PRIMARY KEY, col_text TEXT,
col_text_g TEXT GENERATED ALWAYS AS (SUBSTR(col_text,1,499))
) ENGINE = InnoDB ROW_FORMAT = Compact;
connection con1;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
connection default;
INSERT INTO t1 (col1) VALUES (1) ;
DELETE FROM t1 WHERE col1 = 1;
ALTER TABLE t1 ADD UNIQUE INDEX (col_text_g(9));
BEGIN;
INSERT INTO t1 (col1) VALUES (1);
ROLLBACK;
disconnect con1;
DROP TABLE t1;
# End of 10.4 tests