Bug #74493 mysql_execute_command(THD*): Assertion `thd->is_error() || thd->killed' failed.

Submitted: 22 Oct 2014 6:13 Modified: 12 Nov 2014 22:44
Reporter: Roel Van de Paar Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DML Severity:S6 (Debug Builds)
Version:5.6.20, 5.6.22 OS:Any
Assigned to: CPU Architecture:Any
Tags: debug

[22 Oct 2014 6:13] Roel Van de Paar
Description:
2014-10-23 02:11:30 3729 [Note] /sda/mysql-5.6.20-linux-x86_64-debug/bin/mysqld: ready for connections.
Version: '5.6.20-debug'  socket: '/sda/mysql-5.6.20-linux-x86_64-debug/socket.sock'  port: 17011  MySQL Community Server (GPL)
mysqld: /bzr/mysql-5.6/sql/sql_parse.cc:4581: int mysql_execute_command(THD*): Assertion `thd->is_error() || thd->killed' failed.
15:11:34 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
[...]
Query (7f4efc004ff0): CALL test.p1()

(gdb) bt
#0  0x00007f4fb2ff5771 in pthread_kill () from /lib64/libpthread.so.0
#1  0x0000000000a9035e in my_write_core (sig=6) at /bzr/mysql-5.6/mysys/stacktrace.c:422
#2  0x0000000000723688 in handle_fatal_signal (sig=6) at /bzr/mysql-5.6/sql/signal_handler.cc:230
#3  <signal handler called>
#4  0x00007f4fb1e015c9 in raise () from /lib64/libc.so.6
#5  0x00007f4fb1e02cd8 in abort () from /lib64/libc.so.6
#6  0x00007f4fb1dfa536 in __assert_fail_base () from /lib64/libc.so.6
#7  0x00007f4fb1dfa5e2 in __assert_fail () from /lib64/libc.so.6
#8  0x00000000007d4db3 in mysql_execute_command (thd=0x202c0c0) at /bzr/mysql-5.6/sql/sql_parse.cc:4581
#9  0x00000000007d8fa4 in mysql_parse (thd=0x202c0c0, rawbuf=0x7f4efc004ff0 "CALL test.p1()", length=14, parser_state=0x7f4f1cdf0eb0) at /bzr/mysql-5.6/sql/sql_parse.cc:6245
#10 0x00000000007cc557 in dispatch_command (command=COM_QUERY, thd=0x202c0c0, packet=0x7ccb6e1 "CALL test.p1()", packet_length=14) at /bzr/mysql-5.6/sql/sql_parse.cc:1332
#11 0x00000000007cb646 in do_command (thd=0x202c0c0) at /bzr/mysql-5.6/sql/sql_parse.cc:1034
#12 0x0000000000793a61 in do_handle_one_connection (thd_arg=0x202c0c0) at /bzr/mysql-5.6/sql/sql_connect.cc:982
#13 0x000000000079354a in handle_one_connection (arg=0x202c0c0) at /bzr/mysql-5.6/sql/sql_connect.cc:898
#14 0x0000000000ade888 in pfs_spawn_thread (arg=0x7b85250) at /bzr/mysql-5.6/storage/perfschema/pfs.cc:1860
#15 0x00007f4fb2ff0df3 in start_thread () from /lib64/libpthread.so.0
#16 0x00007f4fb1ec201d in clone () from /lib64/libc.so.6

How to repeat:
DROP DATABASE test;CREATE DATABASE test;USE test;
create table t2(i INT);
CREATE PROCEDURE p1()DELETE IGNORE FROM t2 WHERE i=1;
SET SESSION sql_safe_updates=ON;
CALL test.p1();
[22 Oct 2014 7:07] MySQL Verification Team
Hello Roel,

Thank you for the bug report and test case.

Thanks,
Umesh
[22 Oct 2014 7:07] MySQL Verification Team
// 5.6.22 only debug build affected

mysql> show variables like '%version%';
+-------------------------+---------------------------------------------------------+
| Variable_name           | Value                                                   |
+-------------------------+---------------------------------------------------------+
| innodb_version          | 5.6.22                                                  |
| protocol_version        | 10                                                      |
| slave_type_conversions  |                                                         |
| version                 | 5.6.22-enterprise-commercial-advanced                   |
| version_comment         | MySQL Enterprise Server - Advanced Edition (Commercial) |
| version_compile_machine | x86_64                                                  |
| version_compile_os      | Linux                                                   |
+-------------------------+---------------------------------------------------------+
7 rows in set (0.00 sec)

mysql> DROP DATABASE test;CREATE DATABASE test;USE test;
Query OK, 0 rows affected (0.01 sec)

Query OK, 1 row affected (0.00 sec)

Database changed
mysql> create table t2(i INT);
Query OK, 0 rows affected (0.03 sec)

mysql> CREATE PROCEDURE p1()DELETE IGNORE FROM t2 WHERE i=1;
Query OK, 0 rows affected (0.00 sec)

mysql> SET SESSION sql_safe_updates=ON;
Query OK, 0 rows affected (0.00 sec)

mysql> CALL test.p1();
Query OK, 0 rows affected (0.00 sec)

//
mysql> show variables like '%version%';
+-------------------------+---------------------------------------------------------------+
| Variable_name           | Value                                                         |
+-------------------------+---------------------------------------------------------------+
| innodb_version          | 5.6.22                                                        |
| protocol_version        | 10                                                            |
| slave_type_conversions  |                                                               |
| version                 | 5.6.22-enterprise-commercial-advanced-debug                   |
| version_comment         | MySQL Enterprise Server - Advanced Edition Debug (Commercial) |
| version_compile_machine | x86_64                                                        |
| version_compile_os      | Linux                                                         |
+-------------------------+---------------------------------------------------------------+
7 rows in set (0.00 sec)

mysql> DROP DATABASE test;CREATE DATABASE test;USE test;
Query OK, 1 row affected (0.02 sec)

Query OK, 1 row affected (0.00 sec)

Database changed
mysql> create table t2(i INT);
Query OK, 0 rows affected (0.06 sec)

mysql> CREATE PROCEDURE p1()DELETE IGNORE FROM t2 WHERE i=1;
Query OK, 0 rows affected (0.00 sec)

mysql> SET SESSION sql_safe_updates=ON;
Query OK, 0 rows affected (0.00 sec)

mysql> CALL test.p1();
ERROR 2013 (HY000): Lost connection to MySQL server during query

// Debug build

(gdb) bt
#0  0x0000003bf260c8ac in pthread_kill () from /lib64/libpthread.so.0
#1  0x0000000000afe982 in my_write_core (sig=6) at /export/home/pb2/build/sb_0-13146752-1409933888.09/mysqlcom-pro-5.6.22/mysys/stacktrace.c:422
#2  0x000000000077e6cc in handle_fatal_signal (sig=6) at /export/home/pb2/build/sb_0-13146752-1409933888.09/mysqlcom-pro-5.6.22/sql/signal_handler.cc:230
#3  <signal handler called>
#4  0x0000003bf2232635 in raise () from /lib64/libc.so.6
#5  0x0000003bf2233e15 in abort () from /lib64/libc.so.6
#6  0x0000003bf222b75e in __assert_fail_base () from /lib64/libc.so.6
#7  0x0000003bf222b820 in __assert_fail () from /lib64/libc.so.6
#8  0x00000000008332ba in mysql_execute_command (thd=0x77e5ec0) at /export/home/pb2/build/sb_0-13146752-1409933888.09/mysqlcom-pro-5.6.22/sql/sql_parse.cc:4581
#9  0x00000000008375d1 in mysql_parse (thd=0x77e5ec0, rawbuf=0x7f4ff4004fd0 "CALL test.p1()", length=14, parser_state=0x7f5021fa6680)
    at /export/home/pb2/build/sb_0-13146752-1409933888.09/mysqlcom-pro-5.6.22/sql/sql_parse.cc:6245
#10 0x000000000082a3a2 in dispatch_command (command=COM_QUERY, thd=0x77e5ec0, packet=0x79152e1 "CALL test.p1()", packet_length=14)
    at /export/home/pb2/build/sb_0-13146752-1409933888.09/mysqlcom-pro-5.6.22/sql/sql_parse.cc:1332
#11 0x0000000000829407 in do_command (thd=0x77e5ec0) at /export/home/pb2/build/sb_0-13146752-1409933888.09/mysqlcom-pro-5.6.22/sql/sql_parse.cc:1034
#12 0x00000000007f0887 in do_handle_one_connection (thd_arg=0x77e5ec0) at /export/home/pb2/build/sb_0-13146752-1409933888.09/mysqlcom-pro-5.6.22/sql/sql_connect.cc:982
#13 0x00000000007f0358 in handle_one_connection (arg=0x77e5ec0) at /export/home/pb2/build/sb_0-13146752-1409933888.09/mysqlcom-pro-5.6.22/sql/sql_connect.cc:898
#14 0x0000000000e5c19d in pfs_spawn_thread (arg=0x78f6fb0) at /export/home/pb2/build/sb_0-13146752-1409933888.09/mysqlcom-pro-5.6.22/storage/perfschema/pfs.cc:1860
#15 0x0000003bf26079d1 in start_thread () from /lib64/libpthread.so.0
#16 0x0000003bf22e886d in clone () from /lib64/libc.so.6
[12 Nov 2014 22:44] Paul DuBois
Noted in 5.7.5 changelog.

Executing a DELETE statement on a table with no key in safe-update
mode resulted in an ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE error. For
debug builds, using IGNORE in the the statement resulted in an
assertion being raised.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.060 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.