summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Kosov <claprix@yandex.ru>2021-04-20 22:33:22 +0300
committerEugene Kosov <claprix@yandex.ru>2021-04-21 17:42:16 +0300
commit64eeb250eb550138c46b3ea0b3aeb2843918de90 (patch)
tree3eb2bf0f1f50d5b8e0caa045be562c39ac6a65cc
parent2a7dd64425b6be51715f54756446398618cd1789 (diff)
downloadmariadb-git-64eeb250eb550138c46b3ea0b3aeb2843918de90.tar.gz
MDEV-25457 Server crashes in row_undo_mod_clust_low upon rollback of read-only transaction
node->index was NULL. But it's possible to get dict_table_t* from another source.
-rw-r--r--mysql-test/suite/innodb/r/temporary_table.result5
-rw-r--r--mysql-test/suite/innodb/t/temporary_table.test6
-rw-r--r--storage/innobase/row/row0umod.cc3
3 files changed, 13 insertions, 1 deletions
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))) {