Bug #112491 Assertion Failure in /mysql-8.0.34/sql/item_subselect.cc:2415
Submitted: 26 Sep 2023 11:14 Modified: 27 Sep 2023 15:41
Reporter: xin wen Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DML Severity:S6 (Debug Builds)
Version:8.0.34 OS:Ubuntu (20.04)
Assigned to: CPU Architecture:Any

[26 Sep 2023 11:14] xin wen
Description:
Run these queries:

CREATE TABLE t0 ( c30 INT , c14 INT ) ;
INSERT INTO t0 VALUES ( -38 , -40 ) , ( -59 , 122 ) ;
ALTER TABLE t0 ADD COLUMN c36 INT AFTER c30 ;
INSERT INTO t0 VALUES ( DEFAULT , DEFAULT , DEFAULT ) , ( DEFAULT , DEFAULT , DEFAULT ) ;
SELECT BIT_AND( c21 ) = ALL ( SELECT c36 AS c22 FROM t0 ) AS c48 FROM ( SELECT c30 AS c21 FROM t0 ) AS t1 JOIN t0 ON CONVERT ( 62 IN ( WITH t2 AS ( SELECT -26 AS c19 , -39 AS c17 ) ( SELECT 8537493634414869326 AS c31 HAVING ORD ( t1 . c21 ) * CONVERT ( 118 REGEXP TRIM( -5551258281223471376 ) ^ SIN ( t1 . c21 ) , UNSIGNED ) WINDOW w0 AS ( PARTITION BY t0 . c36 ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING ) UNION ( SELECT ROW_NUMBER ( ) OVER ( ) IS UNKNOWN AS c25 ORDER BY TAN ( -94 ) - IFNULL ( -64 , -75 ) = -99 IS NOT NULL ) ) ) , UNSIGNED ) ^ LOWER ( c14 ) + UNHEX ( 55 ) >> MOD ( -107 , -8 ) & ASCII ( -68 ) = t0 . c14 GROUP BY c21 ;

Will trigger assertion failure:
mysqld: /home/wx/mysql-8.0.34/sql/item_subselect.cc:2415: bool Item_in_subselect::select_in_like_transformer(THD*, Query_block*, Comp_creator*): Assertion `!sl->order_list.first' failed.

GDB info:
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff6af2859 in __GI_abort () at abort.c:79
#2  0x00007ffff6af2729 in __assert_fail_base (fmt=0x7ffff6c88588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55555dfd92e0 "!sl->order_list.first", file=0x55555dfd5160 "/home/wx/mysql-8.0.34/sql/item_subselect.cc", line=2415, function=<optimized out>) at assert.c:92
#3  0x00007ffff6b03fd6 in __GI___assert_fail (assertion=assertion@entry=0x55555dfd92e0 "!sl->order_list.first", file=file@entry=0x55555dfd5160 "/home/wx/mysql-8.0.34/sql/item_subselect.cc", line=line@entry=2415, function=function@entry=0x55555dfd9260 "bool Item_in_subselect::select_in_like_transformer(THD*, Query_block*, Comp_creator*)") at assert.c:101
#4  0x0000555559e2f74c in Item_in_subselect::select_in_like_transformer (this=0x614000160470, thd=0x6270002bf900, select=<optimized out>, func=<optimized out>) at /home/wx/mysql-8.0.34/sql/item_subselect.cc:2418
#5  0x0000555559e2fb1a in Item_in_subselect::select_transformer (this=<optimized out>, thd=<optimized out>, select=<optimized out>) at /home/wx/mysql-8.0.34/sql/item_subselect.cc:2381
#6  0x000055555956fc7a in Query_block::resolve_subquery (this=this@entry=0x6190005406b0, thd=thd@entry=0x6270002bf900) at /home/wx/mysql-8.0.34/sql/sql_resolver.cc:1593
#7  0x000055555958dd45 in Query_block::prepare (this=this@entry=0x6190005406b0, thd=thd@entry=0x6270002bf900, insert_field_list=insert_field_list@entry=0x0) at /home/wx/mysql-8.0.34/sql/sql_resolver.cc:449
#8  0x000055555970ff37 in Query_expression::prepare (this=this@entry=0x61200031b970, thd=thd@entry=0x6270002bf900, sel_result=<optimized out>, insert_field_list=insert_field_list@entry=0x0, added_options=added_options@entry=268435456, removed_options=removed_options@entry=0) at /home/wx/mysql-8.0.34/sql/sql_union.cc:753
#9  0x0000555559e1f1d8 in SubqueryWithResult::prepare (this=0x608001038a50, thd=thd@entry=0x6270002bf900) at /home/wx/mysql-8.0.34/sql/item_subselect.cc:2971
#10 0x0000555559e31605 in Item_subselect::fix_fields (this=this@entry=0x614000160470, thd=thd@entry=0x6270002bf900, ref=ref@entry=0x61200031a698) at /home/wx/mysql-8.0.34/sql/item_subselect.cc:547
#11 0x0000555559e31d02 in Item_in_subselect::fix_fields (this=0x614000160470, thd=0x6270002bf900, ref=0x61200031a698) at /home/wx/mysql-8.0.34/sql/item_subselect.cc:2525
#12 0x0000555559d5166d in Item_func::fix_func_arg (this=this@entry=0x61200031a5f0, thd=thd@entry=0x6270002bf900, arg=arg@entry=0x61200031a698) at /home/wx/mysql-8.0.34/sql/item_func.cc:429
#13 0x0000555559d51c48 in Item_func::fix_fields (this=0x61200031a5f0, thd=0x6270002bf900) at /home/wx/mysql-8.0.34/sql/item_func.cc:418
#14 0x0000555559d5166d in Item_func::fix_func_arg (this=this@entry=0x61200031a770, thd=thd@entry=0x6270002bf900, arg=arg@entry=0x61200031a818) at /home/wx/mysql-8.0.34/sql/item_func.cc:429
#15 0x0000555559d51c48 in Item_func::fix_fields (this=0x61200031a770, thd=0x6270002bf900) at /home/wx/mysql-8.0.34/sql/item_func.cc:418
#16 0x0000555559d5166d in Item_func::fix_func_arg (this=this@entry=0x61200031a8f0, thd=thd@entry=0x6270002bf900, arg=arg@entry=0x61200031a998) at /home/wx/mysql-8.0.34/sql/item_func.cc:429
#17 0x0000555559d51c48 in Item_func::fix_fields (this=0x61200031a8f0, thd=0x6270002bf900) at /home/wx/mysql-8.0.34/sql/item_func.cc:418
#18 0x0000555559d5166d in Item_func::fix_func_arg (this=this@entry=0x61200031aef0, thd=thd@entry=0x6270002bf900, arg=arg@entry=0x61200031af98) at /home/wx/mysql-8.0.34/sql/item_func.cc:429
#19 0x0000555559d51c48 in Item_func::fix_fields (this=0x61200031aef0, thd=0x6270002bf900) at /home/wx/mysql-8.0.34/sql/item_func.cc:418
#20 0x0000555559d5166d in Item_func::fix_func_arg (this=this@entry=0x61200031b370, thd=thd@entry=0x6270002bf900, arg=arg@entry=0x61200031b418) at /home/wx/mysql-8.0.34/sql/item_func.cc:429
#21 0x0000555559d51c48 in Item_func::fix_fields (this=0x61200031b370, thd=0x6270002bf900) at /home/wx/mysql-8.0.34/sql/item_func.cc:418
#22 0x0000555559d5166d in Item_func::fix_func_arg (this=this@entry=0x6150003eba30, thd=thd@entry=0x6270002bf900, arg=arg@entry=0x6150003ebad8) at /home/wx/mysql-8.0.34/sql/item_func.cc:429
#23 0x0000555559d51c48 in Item_func::fix_fields (this=0x6150003eba30, thd=0x6270002bf900) at /home/wx/mysql-8.0.34/sql/item_func.cc:418
#24 0x000055555957e884 in Query_block::setup_join_cond (this=0x6190005361b0, thd=<optimized out>, tables=<optimized out>, in_update=<optimized out>) at /home/wx/mysql-8.0.34/sql/sql_resolver.cc:1743
#25 0x000055555957eb9c in Query_block::setup_join_cond (this=this@entry=0x6190005361b0, thd=thd@entry=0x6270002bf900, tables=tables@entry=0x6190005363c8, in_update=in_update@entry=false) at /home/wx/mysql-8.0.34/sql/sql_resolver.cc:1731
#26 0x000055555957f478 in Query_block::setup_conds (this=this@entry=0x6190005361b0, thd=thd@entry=0x6270002bf900) at /home/wx/mysql-8.0.34/sql/sql_resolver.cc:1711
#27 0x000055555958ce5f in Query_block::prepare (this=this@entry=0x6190005361b0, thd=thd@entry=0x6270002bf900, insert_field_list=insert_field_list@entry=0x0) at /home/wx/mysql-8.0.34/sql/sql_resolver.cc:296
#28 0x00005555595b0c63 in Sql_cmd_select::prepare_inner (this=0x60b000158350, thd=0x6270002bf900) at /home/wx/mysql-8.0.34/sql/sql_select.cc:650
#29 0x00005555595cd20b in Sql_cmd_dml::prepare (this=0x60b000158350, thd=0x6270002bf900) at /home/wx/mysql-8.0.34/sql/sql_select.cc:566
#30 0x00005555595cda8d in Sql_cmd_dml::execute (this=0x60b000158350, thd=0x6270002bf900) at /home/wx/mysql-8.0.34/sql/sql_select.cc:718
#31 0x00005555594bd568 in mysql_execute_command (thd=thd@entry=0x6270002bf900, first_level=first_level@entry=true) at /home/wx/mysql-8.0.34/sql/sql_parse.cc:4719
#32 0x00005555594c0bfe in dispatch_sql_command (thd=0x6270002bf900, parser_state=parser_state@entry=0x7fffc706ec00) at /home/wx/mysql-8.0.34/sql/sql_parse.cc:5368
#33 0x00005555594c38e2 in dispatch_command (thd=thd@entry=0x6270002bf900, com_data=com_data@entry=0x7fffc7070200, command=<optimized out>) at /home/wx/mysql-8.0.34/sql/sql_parse.cc:2054
#34 0x00005555594c7392 in do_command (thd=thd@entry=0x6270002bf900) at /home/wx/mysql-8.0.34/sql/sql_parse.cc:1439
#35 0x000055555989b7be in handle_connection (arg=arg@entry=0x60300016b3a0) at /home/wx/mysql-8.0.34/sql/conn_handler/connection_handler_per_thread.cc:302
#36 0x000055555cc724e9 in pfs_spawn_thread (arg=0x614000140a60) at /home/wx/mysql-8.0.34/storage/perfschema/pfs.cc:3042
#37 0x00007ffff7568609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#38 0x00007ffff6bef133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

How to repeat:
Run the queries above.
[26 Sep 2023 11:42] MySQL Verification Team
Hello xin wen,

Thank you for the report and test case.
Observed that 8.0.34 debug build is affected.

regards,
Umesh
[27 Sep 2023 15:41] Stefan Hinz
Posted by developer:
 
Duplicate of bug #35184353. Closing.