From 653f14c2659160b1fda7f3fceb0988fa90731d4d Mon Sep 17 00:00:00 2001 From: Magne Mahre Date: Wed, 6 Oct 2010 11:01:24 +0200 Subject: Bug#56452 Assertion failed: thd->transaction.stmt.is_empty() || thd->in_sub_stmt In a precursor patch for Bug#52044 (revid:bzr/kostja@stripped), a number of reorganizations of code was made. In addition some assertions were added to ensure the correct transactional state. The reorganization had a small glitch so statements that was active in the query cache was not followed by a statement commit/rollback (this code was removed). A section in the trans_commit_stmt/trans_rollback_stmt code is to clear the thd->transaction.stmt list of affected storage engines. When a new statement is initiated, an assert introduced by the 523044 patch checks if this list is cleared. When the query cache is accessed, this list may be populated, and since it's not committed it will not be cleared. This fix adds explicit statement commit or rollback for statements that is contained in the query cache. --- mysql-test/r/cache_innodb.result | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'mysql-test/r/cache_innodb.result') diff --git a/mysql-test/r/cache_innodb.result b/mysql-test/r/cache_innodb.result index 600ed84c3c9..293d7a3f412 100644 --- a/mysql-test/r/cache_innodb.result +++ b/mysql-test/r/cache_innodb.result @@ -220,3 +220,14 @@ Variable_name Value Qcache_hits 1 set GLOBAL query_cache_size=1048576; drop table t2; +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +BEGIN; +INSERT INTO t1 VALUES(1); +ROLLBACK WORK AND CHAIN NO RELEASE; +SELECT a FROM t1; +a +ROLLBACK WORK AND CHAIN NO RELEASE; +SELECT a FROM t1; +a +ROLLBACK; +DROP TABLE t1; -- cgit v1.2.1