diff --git a/mysql-test/suite/innodb/r/temporary_table.result b/mysql-test/suite/innodb/r/temporary_table.result index 490179fe6cb..0307ba88200 100644 --- a/mysql-test/suite/innodb/r/temporary_table.result +++ b/mysql-test/suite/innodb/r/temporary_table.result @@ -754,3 +754,8 @@ COUNT(*) INSERT INTO t VALUES (0); SET SESSION tx_read_only=OFF; DROP TABLE t; +CREATE TEMPORARY TABLE t (a INT) ENGINE=InnoDB; +INSERT INTO t VALUES (1); +START TRANSACTION READ ONLY; +UPDATE t SET a = NULL; +ROLLBACK; diff --git a/mysql-test/suite/innodb/t/temporary_table.test b/mysql-test/suite/innodb/t/temporary_table.test index 42bd403d0be..d7fe66e2efb 100644 --- a/mysql-test/suite/innodb/t/temporary_table.test +++ b/mysql-test/suite/innodb/t/temporary_table.test @@ -595,3 +595,9 @@ SELECT COUNT(*)FROM t; INSERT INTO t VALUES (0); SET SESSION tx_read_only=OFF; DROP TABLE t; + +CREATE TEMPORARY TABLE t (a INT) ENGINE=InnoDB; +INSERT INTO t VALUES (1); +START TRANSACTION READ ONLY; +UPDATE t SET a = NULL; +ROLLBACK; diff --git a/storage/innobase/row/row0umod.cc b/storage/innobase/row/row0umod.cc index d207aa5b9bc..6ccb2250c05 100644 --- a/storage/innobase/row/row0umod.cc +++ b/storage/innobase/row/row0umod.cc @@ -109,7 +109,8 @@ row_undo_mod_clust_low( ut_ad(success); ut_ad(rec_get_trx_id(btr_cur_get_rec(btr_cur), btr_cur_get_index(btr_cur)) - == thr_get_trx(thr)->id || node->index->table->is_temporary()); + == thr_get_trx(thr)->id + || btr_cur_get_index(btr_cur)->table->is_temporary()); if (mode != BTR_MODIFY_LEAF && dict_index_is_online_ddl(btr_cur_get_index(btr_cur))) {