Bug #28652 | MySQL (with-debug=full) asserts when alter table operations | ||
---|---|---|---|
Submitted: | 24 May 2007 12:37 | Modified: | 18 Jun 2007 19:26 |
Reporter: | Tianlei HU | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 5.0.32, 5.0.33, 5.0.44-bk | OS: | Any |
Assigned to: | Ramil Kalimullin | CPU Architecture: | Any |
Tags: | ALTER TABLE, assertion, debug version |
[24 May 2007 12:37]
Tianlei HU
[24 May 2007 13:20]
Tianlei HU
I have missed one point that, we need to create a innodb table to reproduce the problem. i.e. the reproduce sql should be: create table test(i int) engine=innodb; alter table test comment '123' or create table test(i int) engine=innodb; alter table test alter i set default 0 However, a alter table which needs to copy the whole table to a temporary table would not generate such assertion failure, for example: alter table test modify i int default 0
[24 May 2007 13:36]
Valeriy Kravchuk
Thank you for a problem report. Sorry, but I was not able to repeat the behaviour described with 5.0.44-BK built from today's sources --with-debug=full: mysql> drop table test; ERROR 1051 (42S02): Unknown table 'test' mysql> create table test (i int); Query OK, 0 rows affected (0.01 sec) mysql> alter table test comment 'a test'; Query OK, 0 rows affected (0.02 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> alter table test alter i set default 0; Query OK, 0 rows affected (0.02 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> select version(); +--------------+ | version() | +--------------+ | 5.0.44-debug | +--------------+ 1 row in set (0.01 sec) Please, check again. In case of the same problem, please, send your my.cnf.
[24 May 2007 14:46]
Tianlei HU
Have you tried to create an innodb table, not a default myisam one, as i mentioned in the previous comment? I am using a freshly compile/installed mysqld, with the default my.inf file. This is the screen copy: mysql> select version(); +--------------+ | version() | +--------------+ | 5.0.44-debug | +--------------+ 1 row in set (0.00 sec) mysql> drop table test.test; Query OK, 0 rows affected (0.00 sec) mysql> create table test.test (i int) engine=innodb; Query OK, 0 rows affected (0.00 sec) mysql> alter table test.test comment 'a test'; ERROR 2013 (HY000): Lost connection to MySQL server during query mysql> drop table test.test; ERROR 2006 (HY000): MySQL server has gone away No connection. Trying to reconnect... Connection id: 1 Current database: *** NONE *** Query OK, 0 rows affected (0.01 sec) mysql> create table test.test (i int) engine=innodb; Query OK, 0 rows affected (0.00 sec) mysql> alter table test.test alter i set default 0; ERROR 2013 (HY000): Lost connection to MySQL server during query
[25 May 2007 8:33]
Valeriy Kravchuk
Sorry, I missed your comment. I can repeat with 5.0.44-BK and InnoDB table: openxs@suse:~/dbs/5.0> bin/mysql -uroot test Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.0.44-debug Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> drop table test; Query OK, 0 rows affected (0.01 sec) mysql> create table test (i int) engine=InnoDB; Query OK, 0 rows affected (0.03 sec) mysql> alter table test comment 'a test'; ERROR 2013 (HY000): Lost connection to MySQL server during query mysql> Number of processes running now: 0 070518 08:13:03 mysqld restarted mysql> show create table test\G ERROR 2006 (HY000): MySQL server has gone away No connection. Trying to reconnect... Connection id: 1 Current database: test *************************** 1. row *************************** Table: test Create Table: CREATE TABLE `test` ( `i` int(11) default NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='a test' 1 row in set (0.15 sec) mysql> alter table test alter i set default 0; ERROR 2013 (HY000): Lost connection to MySQL server during query mysql> Number of processes running now: 0 070518 08:13:15 mysqld restarted Resolved stack trace: openxs@suse:~/dbs/5.0> bin/resolve_stack_dump -s /tmp/mysqld5.sym 28652.stack 0x81a6028 handle_segfault + 482 0xffffe410 _end + -141009552 0x401b6b75 _end + 934536405 0x401ae903 _end + 934503011 0x81a0e9f _Z24wait_if_global_read_lockP3THDbb + 131 0x827df7a _Z15ha_commit_transP3THDb + 284 0x82a0dab _Z17mysql_alter_tableP3THDPcS1_P24st_ha_create_informationP13st_table_ listP10Alter_infojP8st_orderb + 10153 0x81bfb2c _Z21mysql_execute_commandP3THD + 6838 0x81c6377 _Z11mysql_parseP3THDPKcjPS2_ + 399 0x81bcb29 _Z16dispatch_command19enum_server_commandP3THDPcj + 1959 0x81bc372 _Z10do_commandP3THD + 534 0x81bb4f4 handle_one_connection + 1046 0x40050aa7 _end + 933069831 0x40247c2e _end + 935130510
[25 May 2007 11:43]
Heikki Tuuri
It is a MySQL assertion that fails. I need to check if InnoDB somehow misuses the ha_commit_trans() call.
[28 May 2007 14:43]
Heikki Tuuri
Dmitri and Konstantin said that this is a MySQL Server bug.
[29 May 2007 11:39]
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/27559 ChangeSet@1.2504, 2007-05-29 16:35:58+05:00, ramil@mysql.com +3 -0 Fix for bug #28652: MySQL (with-debug=full) asserts when alter table operations Problem: we may create a deadlock committing changes in the mysql_alter_table() when LOCK_open is set. Fix: unlock LOCK_open before commit to avoid possible deadlocks.
[1 Jun 2007 17:54]
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/27948 ChangeSet@1.2504, 2007-06-01 22:53:50+05:00, ramil@mysql.com +3 -0 Fix for bug #28652: MySQL (with-debug=full) asserts when alter table operations Problem: we may create a deadlock committing changes in the mysql_alter_table() when LOCK_open is set. Moreover, "in some variants of the ALTER TABLE commit happens earlier, outside of LOCK_open, in other later - inside. It's no good, a storage engine code that is called in between could expect a consistency - either there is a transaction or there is not". Fix: move the commit to happen earlier and outside of the LOCK_open.
[6 Jun 2007 16:55]
Bugs System
Pushed into 5.1.20-beta
[6 Jun 2007 16:58]
Bugs System
Pushed into 5.0.44
[18 Jun 2007 19:26]
Paul DuBois
Noted in 5.0.44, 5.1.20 changelogs. For debug builds, ALTER TABLE could trigger an assertion failure due to occurrence of a deadlock when committing changes.