From cf3c3cce1d1078d6ac2c0d74a3cd0ff444c63db9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 27 Jul 2020 19:33:21 +0300 Subject: [PATCH] MDEV-23304 Insert into TEMPORARY TABLE fails to invoke mtr_t::set_modified() In MDEV-21724 or possibly already in MDEV-12353 a bug was introduced to the handling of temporary tables. Whether or not redo log will be written, mtr_t::set_modified() must be invoked to register any changes to a page. page_cur_insert_rec_low(): Invoke mtr_t::set_modified() also when skipping the redo log write. --- storage/innobase/page/page0cur.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/storage/innobase/page/page0cur.cc b/storage/innobase/page/page0cur.cc index 36fdde82cb3..5f42deaaf8e 100644 --- a/storage/innobase/page/page0cur.cc +++ b/storage/innobase/page/page0cur.cc @@ -1493,7 +1493,10 @@ inc_dir: rec_set_bit_field_1(next_rec, n_owned + 1, REC_NEW_N_OWNED, REC_N_OWNED_MASK, REC_N_OWNED_SHIFT); if (mtr->get_log_mode() != MTR_LOG_ALL) + { + mtr->set_modified(*block); goto copied; + } const byte * const c_start= cur->rec - extra_size; if (extra_size > REC_N_NEW_EXTRA_BYTES && @@ -1532,7 +1535,10 @@ inc_dir: rec_set_bit_field_1(next_rec, n_owned + 1, REC_OLD_N_OWNED, REC_N_OWNED_MASK, REC_N_OWNED_SHIFT); if (mtr->get_log_mode() != MTR_LOG_ALL) + { + mtr->set_modified(*block); goto copied; + } ut_ad(extra_size > REC_N_OLD_EXTRA_BYTES); const byte * const c_start= cur->rec - extra_size;