Bug #74411 void Protocol::end_statement(): Assertion `0' failed. DELETE IGNORE

Submitted: 15 Oct 2014 22:17 Modified: 20 Nov 2019 21:21
Reporter: Roel Van de Paar Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: DML Severity:S6 (Debug Builds)
Version:5.6.20,5.6.25 OS:Any
Assigned to: CPU Architecture:Any
Tags: debug

[15 Oct 2014 22:17] Roel Van de Paar
Description:
Another one in the well-known void Protocol::end_statement() series...

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/protocol.cc:518: void Protocol::end_statement(): Assertion `0' failed.
08:11:35 UTC - mysqld got signal 6 ;

Opt returns OK/no failure (whilst it likely should?)

How to repeat:
DROP DATABASE test;CREATE DATABASE test;USE test;
CREATE TEMPORARY TABLE t1(c1 INT);
SET @@sql_safe_updates=ON;
DELETE IGNORE FROM t1 WHERE c1=5;

or 

DROP DATABASE test;CREATE DATABASE test;USE test;
SET @@session.sql_safe_updates=1;
CREATE TABLE t1(c1 INT,c2 CHAR)PARTITION BY HASH(c1) PARTITIONS 10;
DELETE IGNORE FROM t1 WHERE c1=5;

or

DROP DATABASE test;CREATE DATABASE test;USE test;
SET SESSION sql_safe_updates=ON;
CREATE TABLE t1(c1 INT)ENGINE=InnoDB;
DELETE IGNORE FROM t1 WHERE c1=5;
[15 Oct 2014 22:23] Roel Van de Paar
Actually, this is more serious then I though. Re-start the server after the abort and you see this after standard crash recovery:

2014-10-16 19:19:43 7fede83e5740  InnoDB: Error: table `tmp`.`#sql40e0_1_0` does not exist in the InnoDB internal
InnoDB: data dictionary though MySQL is trying to drop it.
InnoDB: Have you copied the .frm file of the table to the
InnoDB: MySQL database directory from another database?
InnoDB: You can look for further help from
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html

Still, the issue cannot be repeated with optimized
[15 Oct 2014 22:24] Roel Van de Paar
I wonder if the secondary effect in the last comment is a situation not handled properly in InnoDB which could also show in other cases (I have seen this a number of times before... and likely so does support in customer's logs). A review of the code that should handle tmp* work InnoDB vs MySQL may not be wasted here.
[15 Oct 2014 23:44] MySQL Verification Team
C:\dbs>c:\dbs\5.6\bin\mysql -uroot --port=3560 --debug-info --prompt="mysql 5.6 > "
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.22-debug Source distribution

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

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

Query OK, 1 row affected (0.00 sec)

Database changed
mysql 5.6 > CREATE TEMPORARY TABLE t1(c1 INT);
Query OK, 0 rows affected (0.06 sec)

mysql 5.6 > SET @@sql_safe_updates=ON;
Query OK, 0 rows affected (0.07 sec)

mysql 5.6 > DELETE IGNORE FROM t1 WHERE c1=5;
ERROR 2013 (HY000): Lost connection to MySQL server during query

2014-10-14 18:31:43 1044 [Note] C:\dbs\5.6\bin\mysqld: ready for connections.
Version: '5.6.22-debug'  socket: ''  port: 3560  Source distribution
Assertion failed: 0, file protocol.cc, line 518
23:35:06 UTC - mysqld got exception 0x80000003 ;
<CUT>

7ff642964795    mysqld.exe!my_sigabrt_handler()[my_thr_init.c:458]
7ff642f3bfff    mysqld.exe!raise()[winsig.c:594]
7ff642f48e10    mysqld.exe!abort()[abort.c:82]
7ff642f395cb    mysqld.exe!_wassert()[assert.c:380]
7ff6424c365b    mysqld.exe!Protocol::end_statement()[protocol.cc:518]
7ff6425ad9cd    mysqld.exe!dispatch_command()[sql_parse.cc:1760]
7ff6425ab7a2    mysqld.exe!do_command()[sql_parse.cc:1034]
7ff6425fc402    mysqld.exe!do_handle_one_connection()[sql_connect.cc:982]
7ff6425fc232    mysqld.exe!handle_one_connection()[sql_connect.cc:899]
7ff642e16145    mysqld.exe!pfs_spawn_thread()[pfs.cc:1862]
7ff642962d36    mysqld.exe!pthread_start()[my_winthread.c:62]
7ff642f4c655    mysqld.exe!_callthreadstartex()[threadex.c:376]
7ff642f4c8a7    mysqld.exe!_threadstartex()[threadex.c:359]
7ffa83c116ad    KERNEL32.DLL!BaseThreadInitThunk()
7ffa860634a5    ntdll.dll!RtlUserThreadStart()

C:\dbs>c:\dbs\5.6\bin\mysql -uroot --port=3560 --debug-info --prompt="mysql 5.6 > "
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.22 Source distribution

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql 5.6 > 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 5.6 > CREATE TEMPORARY TABLE t1(c1 INT);
Query OK, 0 rows affected (0.06 sec)

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

mysql 5.6 > DELETE IGNORE FROM t1 WHERE c1=5;
Query OK, 0 rows affected (0.00 sec)
[16 Oct 2014 0:00] MySQL Verification Team
C:\dbs>c:\dbs\5.5\bin\mysql -uroot --port=3550 --prompt="mysql 5.5 > "
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.41-debug Source distribution

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

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

Query OK, 1 row affected (0.00 sec)

Database changed
mysql 5.5 > CREATE TEMPORARY TABLE t1(c1 INT);
Query OK, 0 rows affected (0.16 sec)

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

mysql 5.5 > DELETE IGNORE FROM t1 WHERE c1=5;
ERROR 2013 (HY000): Lost connection to MySQL server during query

C:\dbs>c:\dbs\5.7\bin\mysql -uroot --port=3570 --prompt="mysql 5.7 > "
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.7.6-m16-debug Source distribution

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql 5.7 > DROP DATABASE test;CREATE DATABASE test;USE test;
ERROR 1008 (HY000): Can't drop database 'test'; database doesn't exist
Query OK, 1 row affected (0.00 sec)

Database changed
mysql 5.7 > CREATE TEMPORARY TABLE t1(c1 INT);
Query OK, 0 rows affected (0.01 sec)

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

mysql 5.7 > DELETE IGNORE FROM t1 WHERE c1=5;
ERROR 1175 (HY000): You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
[16 Oct 2014 0:01] MySQL Verification Team
Thank you for the bug report.
[17 Oct 2015 5:11] Roel Van de Paar
Updating version
[8 Nov 2016 0:55] Roel Van de Paar
Any possibility of having this one fixed? Thank you
[20 Nov 2019 21:21] Roy Lyseng
Posted by developer:
 
Problem is not reproducible in 5.7.

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

Page generated in 0.043 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.