summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-08-24 09:38:52 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2018-08-24 09:38:52 +0300
commit1b4c5b7327e84f9c9dd86d72b5ae706d9e82d9b0 (patch)
tree775a23f5bf3ba8f224c256f8b48ebb7003846a88
parentc164d0cc6226db586ca62a10b925439ca8fdf086 (diff)
downloadmariadb-git-1b4c5b7327e84f9c9dd86d72b5ae706d9e82d9b0.tar.gz
MDEV-16868 Same query gives different results
An INSERT into a temporary table would fail to set the index page as modified. If there were no other write operations (such as UPDATE or DELETE) to the page, and the page was evicted, we would read back the old contents of the page, causing corruption or loss of data. page_cur_insert_rec_write_log(): Call mtr_t::set_modified() for temporary tables. Normally this is part of the mlog_open() call, but the mlog_open() call was only present in debug builds. This regression was caused by commit 48192f963a3a85a5127da5cc5cf485f07d72bc9d which was preparation for MDEV-11369 and supposed to affect debug builds only. Thanks to Thirunarayanan Balathandayuthapani for debugging.
-rw-r--r--storage/innobase/page/page0cur.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/storage/innobase/page/page0cur.cc b/storage/innobase/page/page0cur.cc
index 3aea43bfba0..6bdb7f56842 100644
--- a/storage/innobase/page/page0cur.cc
+++ b/storage/innobase/page/page0cur.cc
@@ -857,7 +857,8 @@ page_cur_insert_rec_write_log(
ulint i;
if (dict_table_is_temporary(index->table)) {
- ut_ad(!mlog_open(mtr, 0));
+ mtr->set_modified();
+ ut_ad(mtr->get_log_mode() == MTR_LOG_NO_REDO);
return;
}