summaryrefslogtreecommitdiff
path: root/sql/sql_handler.cc
diff options
context:
space:
mode:
authorNikita Malyavin <nikitamalyavin@gmail.com>2021-10-07 17:02:26 +0300
committerNikita Malyavin <nikitamalyavin@gmail.com>2021-10-20 15:15:21 +0300
commitcaebe151c18a3415466cca88dbdacb8ec9597a29 (patch)
tree0c2fd1d2c43969b16e190cfe71700d1edb682d54 /sql/sql_handler.cc
parent1811fd51fbae9e6c1f06ce93faef2bf1279cd3b6 (diff)
downloadmariadb-git-caebe151c18a3415466cca88dbdacb8ec9597a29.tar.gz
MDEV-22445 Crash on HANDLER READ NEXT after XA PREPARE
The assertion is absolutely correct since no data access is possible after XA PREPARE. The check is added in mysql_ha_read.
Diffstat (limited to 'sql/sql_handler.cc')
-rw-r--r--sql/sql_handler.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index 7c2122b6a0a..ec3756eceba 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -697,6 +697,9 @@ retry:
if (!(handler= mysql_ha_find_handler(thd, tables->alias)))
goto err0;
+ if (thd->transaction.xid_state.check_has_uncommitted_xa())
+ goto err0;
+
table= handler->table;
tables->table= table; // This is used by fix_fields
table->pos_in_table_list= tables;