Bug #55930 | Assertion `thd->transaction.stmt.is_empty() || thd->in_sub_stmt || (thd->state.. | ||
---|---|---|---|
Submitted: | 12 Aug 2010 0:33 | Modified: | 20 Nov 2010 17:41 |
Reporter: | Elena Stepanova | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: DML | Severity: | S2 (Serious) |
Version: | 5.5.6-m3-debug, 5.6.0-m4-debug | OS: | Any |
Assigned to: | Jon Olav Hauglid | CPU Architecture: | Any |
[12 Aug 2010 0:33]
Elena Stepanova
[23 Sep 2010 10:30]
Jon Olav Hauglid
Also seen when running RQG tests on mysql-5.5-runtime.
[1 Oct 2010 6:34]
Jon Olav Hauglid
Also seen when running RQG tests on mysql-5.5-runtime for non-partitioned tables. Setting bug to Verified and assigning it to myself for further investigation.
[13 Oct 2010 11:53]
Jon Olav Hauglid
MTR test case: --source include/have_debug_sync.inc CREATE TABLE t1(a INT) engine=InnoDB; INSERT INTO t1 VALUES (1), (2); connect (con1, localhost, root); connect (con2, localhost, root); connection con1; SET SESSION lock_wait_timeout= 1; SET DEBUG_SYNC= 'ha_admin_open_ltable SIGNAL opti_recreate WAIT_FOR opti_analyze'; --send OPTIMIZE TABLE t1 connection con2; SET DEBUG_SYNC= 'now WAIT_FOR opti_recreate'; SET DEBUG_SYNC= 'after_lock_tables_takes_lock SIGNAL thrlock WAIT_FOR release_thrlock'; --send INSERT INTO t1 VALUES (3) connection default; SET DEBUG_SYNC= 'now WAIT_FOR thrlock'; SET DEBUG_SYNC= 'now SIGNAL opti_analyze'; connection con1; --reap SET DEBUG_SYNC= 'now SIGNAL release_thrlock'; connection con2; --reap connection default; disconnect con1; disconnect con2; DROP TABLE t1;
[13 Oct 2010 11:55]
Jon Olav Hauglid
Bug #57148 was marked as a duplicate of this bug.
[13 Oct 2010 14:16]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/120691 3164 Jon Olav Hauglid 2010-10-13 Bug #55930 Assertion `thd->transaction.stmt.is_empty() || thd->in_sub_stmt || (thd->state.. OPTIMIZE TABLE is not directly supported by InnoDB. Instead, recreate and analyze of the table is done. After recreate, the table is closed and locks are released before the table is reopened and locks re-acquired for the analyze phase. This assertion was triggered if OPTIMIZE TABLE failed to acquire thr_lock locks before starting the analyze phase. The assertion tests (among other things) that there no active statement transaction. However, as part of acquiring the thr_lock lock, external_lock() is called for InnoDB tables and this causes a statement transaction to be started. If thr_multi_lock() later fails (e.g. due to timeout), the failure handling code causes this assert to be triggered. This patch fixes the problem by doing rollback of the current statement transaction in case open_ltable (used by OPTIMIZE TABLE) fails to acquire thr_lock locks. Test case added to lock_sync.test.
[13 Oct 2010 14:29]
Konstantin Osipov
OK to push.
[13 Oct 2010 14:58]
Jon Olav Hauglid
Pushed to mysql-5.5-runtime.
[14 Oct 2010 9:05]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/120755 3165 Jon Olav Hauglid 2010-10-14 Follow-up for Bug #55930 Assertion `thd->transaction.stmt.is_empty() || thd->in_sub_stmt || (thd->state.. Don't rollback statement transactions if we are in a sub-statement. This could for example happen for open_ltable() when opening the general log during execution of a stored procedure.
[13 Nov 2010 16:11]
Bugs System
Pushed into mysql-trunk 5.6.99-m5 (revid:alexander.nozdrin@oracle.com-20101113155825-czmva9kg4n31anmu) (version source revid:alexander.nozdrin@oracle.com-20101113152450-2zzcm50e7i4j35v7) (merge vers: 5.6.1-m4) (pib:21)
[13 Nov 2010 16:31]
Bugs System
Pushed into mysql-next-mr (revid:alexander.nozdrin@oracle.com-20101113160336-atmtmfb3mzm4pz4i) (version source revid:vasil.dimov@oracle.com-20100629074804-359l9m9gniauxr94) (pib:21)
[20 Nov 2010 17:41]
Paul DuBois
Noted in 5.5.8 changelog. OPTIMIZE TABLE for InnoDB tables could raise an assertion.
[16 Dec 2010 22:27]
Bugs System
Pushed into mysql-5.5 5.5.9 (revid:jonathan.perkin@oracle.com-20101216101358-fyzr1epq95a3yett) (version source revid:jonathan.perkin@oracle.com-20101216101358-fyzr1epq95a3yett) (merge vers: 5.5.9) (pib:24)