Bug #58933 | Assertion `thd- >is_error()' fails when ongoing OPTIMIZE TABLE is killed | ||
---|---|---|---|
Submitted: | 15 Dec 2010 1:13 | Modified: | 12 Jan 2011 18:17 |
Reporter: | Elena Stepanova | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: DDL | Severity: | S3 (Non-critical) |
Version: | 5.5.9-debug, 5.6.1-m5-debug | OS: | Any |
Assigned to: | Jon Olav Hauglid | CPU Architecture: | Any |
Tags: | assertion, KILL, Optimize |
[15 Dec 2010 1:13]
Elena Stepanova
[15 Dec 2010 7:54]
MySQL Verification Team
Valeriy, run two instances of "call p1" on a debug build of 5.5: delimiter $ drop table if exists `t1` $ create table `t1`(`a` int)engine=innodb$ drop procedure if exists `p1`$ create procedure `p1`() begin declare continue handler for sqlexception begin end; repeat select id from information_schema.processlist where info like '%optimize table%' limit 1 into @id; optimize table `t1`; prepare stmt from 'kill query @id'; execute stmt; deallocate prepare stmt; until 1=2 end repeat; end $ delimiter ; call `p1`();
[15 Dec 2010 9:09]
Jon Olav Hauglid
Could be a duplicate of Bug#54109
[15 Dec 2010 9:32]
Jon Olav Hauglid
A different test case: CREATE TABLE t1 (a INT) ENGINE=InnoDB; INSERT INTO t1 VALUES (1), (2); connect (con1,localhost,root); let $ID= `SELECT connection_id()`; while (1) { --send OPTIMIZE TABLE t1 connection default; eval KILL QUERY $id; connection con1; --reap }
[15 Dec 2010 9:40]
Valeriy Kravchuk
Verified with last test case from Shane on 32-bit Ubuntu 10.04 (current mysql-5.5-security tree): Version: '5.5.9-valgrind-max-debug' socket: '/tmp/mysql.sock' port: 3306 Source distribution mysqld: /home2/openxs/bzr2/mysql-5.5-security/sql/sql_admin.cc:731: bool mysql_admin_table(THD*, TABLE_LIST*, HA_CHECK_OPT*, const char*, thr_lock_type, bool, bool, uint, int (*)(THD*, TABLE_LIST*, HA_CHECK_OPT*), int (handler::*)(THD*, HA_CHECK_OPT*), int (*)(THD*, TABLE_LIST*)): Assertion `thd->is_error()' failed. 101215 11:38:13 - mysqld got signal 6 ; ...
[15 Dec 2010 9:59]
Jon Olav Hauglid
Bug#54109 was marked as a duplicate of this bug.
[15 Dec 2010 10:37]
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/126908 3195 Jon Olav Hauglid 2010-12-15 Bug #58933 Assertion `thd- >is_error()' fails on shutdown with ongoing OPTIMIZE TABLE OPTIMIZE TABLE for InnoDB tables is handled as recreate + analyze. The triggered assert checked that an error had been reported if either recreate or analyze failed. However the assert failed to take into account that they could have failed because OPTIMIZE TABLE had been victim of KILL QUERY, KILL CONNECTION or server shutdown. This patch adjusts the assert to take this possibility into account. The problem was only noticeable on debug versions of the server. Test case added to innodb_mysql_sync.test.
[10 Jan 2011 13:13]
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/128290 3228 Jon Olav Hauglid 2011-01-10 Bug #58933 Assertion `thd- >is_error()' fails on shutdown with ongoing OPTIMIZE TABLE OPTIMIZE TABLE for InnoDB tables is handled as recreate + analyze. The triggered assert checked that an error had been reported if either recreate or analyze failed. However the assert failed to take into account that they could have failed because OPTIMIZE TABLE had been victim of KILL QUERY, KILL CONNECTION or server shutdown. This patch adjusts the assert to take this possibility into account. The problem was only noticeable on debug versions of the server. Test case added to innodb_mysql_sync.test.
[10 Jan 2011 13:27]
Bugs System
Pushed into mysql-trunk 5.6.2 (revid:jon.hauglid@oracle.com-20110110132613-67jwde8yl5a751t2) (version source revid:jon.hauglid@oracle.com-20110110132613-67jwde8yl5a751t2) (merge vers: 5.6.2) (pib:24)
[10 Jan 2011 13:27]
Bugs System
Pushed into mysql-5.5 5.5.9 (revid:jon.hauglid@oracle.com-20110110131223-lqx0cgt1w7h64e2y) (version source revid:jon.hauglid@oracle.com-20110110131223-lqx0cgt1w7h64e2y) (merge vers: 5.5.9) (pib:24)
[12 Jan 2011 18:17]
Paul DuBois
Noted in 5.5.9, 5.6.2 changelogs. OPTIMIZE TABLE for an InnoDB table could raise an assertion if the operation failed because it had been killed.