[MDEV-17741] Assertion `thd->Item_change_list::is_empty()' failed in mysql_parse after unsuccessful PS Created: 2018-11-16  Updated: 2018-12-21  Resolved: 2018-12-21

Status: Closed
Project: MariaDB Server
Component/s: Parser, Prepared Statements
Affects Version/s: 10.2
Fix Version/s: 10.2.20

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Alexander Barkov
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates MDEV-17738 Server crashes in Item::delete_self o... Closed
Relates
relates to MDEV-17738 Server crashes in Item::delete_self o... Closed

 Description   

Attention: it can very well be related to MDEV-17738. The assertion failure happens after a similar failing EXECUTE, and it is also reproducible only on 10.2.

SET SQL_MODE= 'STRICT_ALL_TABLES';
 
CREATE TABLE t1 (a INT); 
PREPARE stmt FROM "CREATE TABLE tmp AS SELECT * FROM t1 WHERE 'foo' && 0";
--error ER_TRUNCATED_WRONG_VALUE
EXECUTE stmt;
SELECT a FROM t1 GROUP BY NULL WITH ROLLUP;
 
# Cleanup
DROP TABLE t1;

10.2 7e75643778

mysqld: /data/src/10.2/sql/sql_parse.cc:8034: void mysql_parse(THD*, char*, uint, Parser_state*, bool, bool): Assertion `thd->Item_change_list::is_empty()' failed.
181116 15:24:27 [ERROR] mysqld got signal 6 ;
 
#7  0x00007f5c56baaee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#8  0x000055d6630f7abc in mysql_parse (thd=0x7f5c40000b00, rawbuf=0x7f5c4015c968 "SELECT a FROM t1 GROUP BY NULL WITH ROLLUP", length=42, parser_state=0x7f5c50e86200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:8034
#9  0x000055d6630e528f in dispatch_command (command=COM_QUERY, thd=0x7f5c40000b00, packet=0x7f5c4008c171 "", packet_length=42, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1824
#10 0x000055d6630e3bf2 in do_command (thd=0x7f5c40000b00) at /data/src/10.2/sql/sql_parse.cc:1378
#11 0x000055d66323614d in do_handle_one_connection (connect=0x55d666647930) at /data/src/10.2/sql/sql_connect.cc:1335
#12 0x000055d663235eda in handle_one_connection (arg=0x55d666647930) at /data/src/10.2/sql/sql_connect.cc:1241
#13 0x000055d66365953c in pfs_spawn_thread (arg=0x55d6665ab0b0) at /data/src/10.2/storage/perfschema/pfs.cc:1862
#14 0x00007f5c58889494 in start_thread (arg=0x7f5c50e87700) at pthread_create.c:333
#15 0x00007f5c56c6793f in clone () from /lib/x86_64-linux-gnu/libc.so.6



 Comments   
Comment by Elena Stepanova [ 2018-12-04 ]

Here is a very similar test case which causes the same failure but does not require ROLLUP:

SET SQL_MODE= 'STRICT_ALL_TABLES';
 
CREATE TABLE t1 (a INT); 
PREPARE stmt FROM "CREATE TABLE tmp AS SELECT * FROM t1 WHERE 'foo' && 0";
--error ER_TRUNCATED_WRONG_VALUE
EXECUTE stmt;
 
SET @a = REPLACE( @@global.optimizer_switch, '=on', '=off' ) ;
 
# Cleanup
DROP TABLE t1;

It looks even more likely to be the same as MDEV-17738, whoever ends up fixing it, please make sure both are fixed at the same time.

Generated at Thu Feb 08 08:38:45 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.