diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2017-05-09 10:00:49 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2017-05-09 10:00:49 +0300 |
commit | e8889c800223db6a9b9e6d02dcb09a97524a1f16 (patch) | |
tree | 401f16d5f14c7c9cd36fa7527be673a6d114fab1 | |
parent | 9a73af0152b4efee235147b0a16f31400e0c1f90 (diff) | |
download | mariadb-git-e8889c800223db6a9b9e6d02dcb09a97524a1f16.tar.gz |
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.)
-rw-r--r-- | mysql-test/suite/innodb/r/innodb-blob.result | 6 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/innodb-blob.test | 8 | ||||
-rw-r--r-- | storage/innobase/row/row0umod.cc | 13 |
3 files changed, 22 insertions, 5 deletions
diff --git a/mysql-test/suite/innodb/r/innodb-blob.result b/mysql-test/suite/innodb/r/innodb-blob.result index ec37492c279..d48bfdf0f80 100644 --- a/mysql-test/suite/innodb/r/innodb-blob.result +++ b/mysql-test/suite/innodb/r/innodb-blob.result @@ -97,6 +97,12 @@ SELECT info FROM information_schema.processlist WHERE state = 'debug sync point: before_row_upd_extern'; info 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; connection default; ERROR HY000: Lost connection to MySQL server during query diff --git a/mysql-test/suite/innodb/t/innodb-blob.test b/mysql-test/suite/innodb/t/innodb-blob.test index d2484e2175d..1c91305b0ee 100644 --- a/mysql-test/suite/innodb/t/innodb-blob.test +++ b/mysql-test/suite/innodb/t/innodb-blob.test @@ -139,6 +139,14 @@ SET DEBUG_SYNC='now WAIT_FOR have_latch'; SELECT info FROM information_schema.processlist 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 --source include/restart_mysqld.inc diff --git a/storage/innobase/row/row0umod.cc b/storage/innobase/row/row0umod.cc index ba072a72aa1..eefe9fb2bd8 100644 --- a/storage/innobase/row/row0umod.cc +++ b/storage/innobase/row/row0umod.cc @@ -1169,16 +1169,19 @@ close_table: node->new_trx_id = trx_id; node->cmpl_info = cmpl_info; - if (UNIV_UNLIKELY(!row_undo_search_clust_to_pcur(node))) { - /* This should never occur. As long as this - rolling-back transaction exists, the PRIMARY KEY value - pointed to by the undo log record must exist. + if (!row_undo_search_clust_to_pcur(node)) { + /* As long as this rolling-back transaction exists, + the PRIMARY KEY value pointed to by the undo log + 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 record after successfully acquiring an exclusive lock on the the clustered index record. That lock will not be released before the transaction is committed or fully rolled back. */ - ut_ad(0); + ut_ad(node->pcur.btr_cur.low_match == node->ref->n_fields); goto close_table; } |