summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-06-21 18:13:28 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-06-21 18:13:28 +0300
commit9dc50ea2293640f8153bc806612fd72634498010 (patch)
treef81bad024ec145cbe81b737675a12cd323075dcd
parente46f76c9749d7758765ba274a212cfc2dcf3eeb8 (diff)
downloadmariadb-git-9dc50ea2293640f8153bc806612fd72634498010.tar.gz
MDEV-25979 Invalid page number written to DB_ROLL_PTR
trx_undo_report_row_operation(): Fix a race condition that was introduced in commit f74023b955b5825fc3e957f644d5ee75c8171c98 (MDEV-15090). We must not access undo_block after the page latch has been released in mtr_t::commit(), because the block could be evicted or replaced.
-rw-r--r--storage/innobase/trx/trx0rec.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/storage/innobase/trx/trx0rec.cc b/storage/innobase/trx/trx0rec.cc
index 9c7106facaf..e011b3f5d8e 100644
--- a/storage/innobase/trx/trx0rec.cc
+++ b/storage/innobase/trx/trx0rec.cc
@@ -2054,12 +2054,11 @@ trx_undo_report_row_operation(
goto err_exit;
}
- mtr_commit(&mtr);
+ mtr.commit();
} else {
/* Success */
- mtr_commit(&mtr);
-
undo->top_page_no = undo_block->page.id.page_no();
+ mtr.commit();
undo->top_offset = offset;
undo->top_undo_no = trx->undo_no++;
undo->guess_block = undo_block;