diff options
-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; } |