Commit e8889c80 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-12745 InnoDB Assertion `0' failed at row0umod.cc:1181

row_undo_mod_parse_undo_rec(): Relax the too strict assertion and
correct the comment.

innodb.innodb-blob: Force a flush of the redo log right before
killing the server, to ensure that the code path gets exercised.
(The bogus debug assertion failed on the rollback of the statement
UPDATE t3 SET c=REPEAT('j',3000) WHERE a=2 which did not modify
any indexes before the server was killed.)
parent 9a73af01
...@@ -97,6 +97,12 @@ SELECT info FROM information_schema.processlist ...@@ -97,6 +97,12 @@ SELECT info FROM information_schema.processlist
WHERE state = 'debug sync point: before_row_upd_extern'; WHERE state = 'debug sync point: before_row_upd_extern';
info info
UPDATE t3 SET c=REPEAT('i',3000) WHERE a=2 UPDATE t3 SET c=REPEAT('i',3000) WHERE a=2
connect con3,localhost,root,,;
SET GLOBAL innodb_flush_log_at_trx_commit=1;
DELETE FROM t1;
ROLLBACK;
disconnect con3;
connection con2;
disconnect con2; disconnect con2;
connection default; connection default;
ERROR HY000: Lost connection to MySQL server during query ERROR HY000: Lost connection to MySQL server during query
......
...@@ -139,6 +139,14 @@ SET DEBUG_SYNC='now WAIT_FOR have_latch'; ...@@ -139,6 +139,14 @@ SET DEBUG_SYNC='now WAIT_FOR have_latch';
SELECT info FROM information_schema.processlist SELECT info FROM information_schema.processlist
WHERE state = 'debug sync point: before_row_upd_extern'; WHERE state = 'debug sync point: before_row_upd_extern';
connect (con3,localhost,root,,);
SET GLOBAL innodb_flush_log_at_trx_commit=1;
DELETE FROM t1;
ROLLBACK;
disconnect con3;
connection con2;
--let $shutdown_timeout=0 --let $shutdown_timeout=0
--source include/restart_mysqld.inc --source include/restart_mysqld.inc
......
...@@ -1169,16 +1169,19 @@ row_undo_mod_parse_undo_rec( ...@@ -1169,16 +1169,19 @@ row_undo_mod_parse_undo_rec(
node->new_trx_id = trx_id; node->new_trx_id = trx_id;
node->cmpl_info = cmpl_info; node->cmpl_info = cmpl_info;
if (UNIV_UNLIKELY(!row_undo_search_clust_to_pcur(node))) { if (!row_undo_search_clust_to_pcur(node)) {
/* This should never occur. As long as this /* As long as this rolling-back transaction exists,
rolling-back transaction exists, the PRIMARY KEY value the PRIMARY KEY value pointed to by the undo log
pointed to by the undo log record must exist. record must exist. But, it is possible that the record
was not modified yet (the DB_ROLL_PTR does not match
node->roll_ptr) and thus there is nothing to roll back.
btr_cur_upd_lock_and_undo() only writes the undo log btr_cur_upd_lock_and_undo() only writes the undo log
record after successfully acquiring an exclusive lock record after successfully acquiring an exclusive lock
on the the clustered index record. That lock will not on the the clustered index record. That lock will not
be released before the transaction is committed or be released before the transaction is committed or
fully rolled back. */ fully rolled back. */
ut_ad(0); ut_ad(node->pcur.btr_cur.low_match == node->ref->n_fields);
goto close_table; goto close_table;
} }
......
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