[Commits] a56def32ddd: MDEV-18632: wsrep_is_wsrep_xid: Conditional jump or move depends on uninitialised value
revision-id: a56def32ddd428f5adbee8ea4c0b081f0cfcdde0 (mariadb-10.3.6-142-ga56def32ddd) parent(s): f2f0c2004408a38a428d6c6346a8f2d2d69cd599 author: Jan Lindström committer: Jan Lindström timestamp: 2019-02-19 16:11:06 +0200 message: MDEV-18632: wsrep_is_wsrep_xid: Conditional jump or move depends on uninitialised value Transaction XID is not initialized before transaction is started. --- mysql-test/suite/innodb/r/innodb-rollback.result | 10 ++++++++++ mysql-test/suite/innodb/t/innodb-rollback.test | 17 +++++++++++++++++ storage/innobase/handler/ha_innodb.cc | 2 +- 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/innodb/r/innodb-rollback.result b/mysql-test/suite/innodb/r/innodb-rollback.result new file mode 100644 index 00000000000..5eca7ad6967 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-rollback.result @@ -0,0 +1,10 @@ +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +connect con1,localhost,root,,test; +ALTER TABLE t1; +connect con2,localhost,root,,test; +SELECT f() FROM t1; +ERROR 42000: FUNCTION test.f does not exist +disconnect con2; +disconnect con1; +connection default; +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/innodb-rollback.test b/mysql-test/suite/innodb/t/innodb-rollback.test new file mode 100644 index 00000000000..1d3e05b021f --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-rollback.test @@ -0,0 +1,17 @@ +--source include/have_innodb.inc + +# +# MDEV-18632: wsrep_is_wsrep_xid: Conditional jump or move depends on uninitialised value +# +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +--connect (con1,localhost,root,,test) +ALTER TABLE t1; +--connect (con2,localhost,root,,test) +--error ER_SP_DOES_NOT_EXIST +SELECT f() FROM t1; + +# Cleanup +--disconnect con2 +--disconnect con1 +--connection default +DROP TABLE t1; diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index b0e58872ad8..5727934d23f 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -4712,7 +4712,7 @@ innobase_rollback( trx is being rolled back due to BF abort, clear XID in order to avoid writing it to rollback segment out of order. The XID will be reassigned when the transaction is replayed. */ - if (wsrep_is_wsrep_xid(trx->xid)) { + if (trx->state != TRX_STATE_NOT_STARTED && wsrep_is_wsrep_xid(trx->xid)) { trx->xid->null(); } #endif /* WITH_WSREP */
participants (1)
-
jan