Description:
Run these queries:
CREATE TABLE t0 ( c62 BOOL ) ;
INSERT INTO t0 VALUES ( DEFAULT ) , ( DEFAULT ) ;
CREATE INDEX i0 ON t0 ( c62 ) ;
INSERT INTO t0 VALUES ( DEFAULT ) , ( DEFAULT ) ;
SELECT RANK ( ) OVER ( ) & - OCT ( RAND ( ) = ALL ( SELECT ASCII ( -123 ) = ~ SIGN ( ( SELECT c62 IS NOT FALSE AS c52 FROM t0 LIMIT 1 ) & TAN ( t0 . c62 ) % RPAD ( t0 . c62 , '~4\'<,GrwTZygliaD~Rteb;WFcI2$W(?cciqDosHXMV#QGz^R!Yq4G' , 'Fh]gtH298,*QZM=zn`<t`8m-r/A' IS FALSE ) % LN ( -55 < -38 AND 114 < -61 ) ) = ALL ( SELECT c62 AS c4 FROM t0 ) = t0 . c62 AS c19 ) ) % MOD ( 100 , COUNT( * ) OVER ( ORDER BY c62 NOT BETWEEN -44 AND LOG ( 65 , -99 ) % ~ SIGN ( 70 ) ) / SIN ( 68 ) ) = ( TRUNCATE ( c62 , GROUP_CONCAT( c62 , -76 ORDER BY ( SELECT IFNULL ( c62 , -81 ) + REPEAT ( + ~ REPLACE ( 84 , '6xg9E(.5p7OkfTzdp&x5M~4&cp=Bcqw(q' , '>' ) , 'p6G8g)<v?)dQkPfC z-y@' ) AS c30 FROM t0 LIMIT 1 ) - TRUNCATE ( RAND ( ) IS NOT FALSE AND RAND ( ) IN ( RAND ( ) ) IS NOT UNKNOWN , -96 ) SEPARATOR '' ) ) ) AS c30 FROM t0 GROUP BY c62 WITH ROLLUP ;
Will trigger assertion failure:
/home/wx/mysql-8.0.34/sql/sql_executor.cc:4222: replace_embedded_rollup_references_with_tmp_fields(THD*, Item*, mem_root_deque<Item*>*)::<lambda(Item*, Item*, unsigned int)>: Assertion `false' 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=0x55555dcf5fa0 "false", file=0x55555dcfe8e0 "/home/wx/mysql-8.0.34/sql/sql_executor.cc", line=4222, function=<optimized out>) at assert.c:92
#3 0x00007ffff6b03fd6 in __GI___assert_fail (assertion=assertion@entry=0x55555dcf5fa0 "false", file=file@entry=0x55555dcfe8e0 "/home/wx/mysql-8.0.34/sql/sql_executor.cc", line=line@entry=4222, function=function@entry=0x55555dcfbb20 "replace_embedded_rollup_references_with_tmp_fields(THD*, Item*, mem_root_deque<Item*>*)::<lambda(Item*, Item*, unsigned int)>") at assert.c:101
#4 0x00005555593e85b4 in <lambda(Item*, Item*, unsigned int)>::operator()(Item *, Item *, unsigned int) const (__closure=__closure@entry=0x60300021f8b0, sub_item=0x612000333df0) at /home/wx/mysql-8.0.34/sql/sql_executor.cc:4222
#5 0x00005555593ee0e0 in std::_Function_handler<ReplaceResult(Item*, Item*, unsigned int), replace_embedded_rollup_references_with_tmp_fields(THD*, Item*, mem_root_deque<Item*>*)::<lambda(Item*, Item*, unsigned int)> >::_M_invoke(const std::_Any_data &, Item *&&, Item *&&, unsigned int &&) (__functor=..., __args#0=@0x7fffc70746e0: 0x612000333df0, __args#1=<optimized out>, __args#2=<optimized out>) at /usr/include/c++/9/bits/std_function.h:283
#6 0x0000555559593498 in std::function<ReplaceResult (Item*, Item*, unsigned int)>::operator()(Item*, Item*, unsigned int) const (this=this@entry=0x7fffc7074a40, __args#0=__args#0@entry=0x612000333df0, __args#1=<optimized out>, __args#1@entry=0x6120003184f0, __args#2=__args#2@entry=0) at /usr/include/c++/9/bits/std_function.h:683
#7 0x000055555955cd41 in WalkAndReplace(THD*, Item*, std::function<ReplaceResult (Item*, Item*, unsigned int)> const&) (thd=<optimized out>, item=0x6120003184f0, get_new_item=...) at /home/wx/mysql-8.0.34/sql/sql_resolver.cc:4786
#8 0x000055555955ccc4 in WalkAndReplace(THD*, Item*, std::function<ReplaceResult (Item*, Item*, unsigned int)> const&) (thd=thd@entry=0x6270002bf900, item=item@entry=0x615000408b30, get_new_item=...) at /home/wx/mysql-8.0.34/sql/sql_resolver.cc:4796
#9 0x00005555593e180a in replace_embedded_rollup_references_with_tmp_fields (thd=thd@entry=0x6270002bf900, item=item@entry=0x615000408b30, fields=fields@entry=0x613000e02910) at /home/wx/mysql-8.0.34/sql/sql_executor.cc:4225
#10 0x00005555593e9e1f in change_to_use_tmp_fields (fields=fields@entry=0x613000e02910, thd=<optimized out>, ref_item_array=..., res_fields=<optimized out>, added_non_hidden_fields=<optimized out>) at /home/wx/mysql-8.0.34/sql/sql_executor.cc:4308
#11 0x00005555595cb270 in JOIN::make_tmp_tables_info (this=this@entry=0x6190005460b0) at /home/wx/mysql-8.0.34/sql/sql_select.cc:4849
#12 0x0000555559495da4 in JOIN::optimize (this=0x6190005460b0, finalize_access_paths=finalize_access_paths@entry=true) at /home/wx/mysql-8.0.34/sql/sql_optimizer.cc:1021
#13 0x00005555595b28b0 in Query_block::optimize (this=this@entry=0x6190005339b0, thd=thd@entry=0x6270002bf900, finalize_access_paths=finalize_access_paths@entry=true) at /home/wx/mysql-8.0.34/sql/sql_select.cc:2013
#14 0x0000555559714de9 in Query_expression::optimize (this=this@entry=0x612000315af0, thd=thd@entry=0x6270002bf900, materialize_destination=materialize_destination@entry=0x0, create_iterators=create_iterators@entry=true, finalize_access_paths=finalize_access_paths@entry=true) at /home/wx/mysql-8.0.34/sql/sql_union.cc:1006
#15 0x00005555595b1ee9 in Sql_cmd_dml::execute_inner (this=0x60b0001584b0, thd=0x6270002bf900) at /home/wx/mysql-8.0.34/sql/sql_select.cc:1007
#16 0x00005555595ce209 in Sql_cmd_dml::execute (this=0x60b0001584b0, thd=0x6270002bf900) at /home/wx/mysql-8.0.34/sql/sql_select.cc:793
#17 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
#18 0x00005555594c0bfe in dispatch_sql_command (thd=0x6270002bf900, parser_state=parser_state@entry=0x7fffc7078c00) at /home/wx/mysql-8.0.34/sql/sql_parse.cc:5368
#19 0x00005555594c38e2 in dispatch_command (thd=thd@entry=0x6270002bf900, com_data=com_data@entry=0x7fffc707a200, command=<optimized out>) at /home/wx/mysql-8.0.34/sql/sql_parse.cc:2054
#20 0x00005555594c7392 in do_command (thd=thd@entry=0x6270002bf900) at /home/wx/mysql-8.0.34/sql/sql_parse.cc:1439
#21 0x000055555989b7be in handle_connection (arg=arg@entry=0x603000162280) at /home/wx/mysql-8.0.34/sql/conn_handler/connection_handler_per_thread.cc:302
#22 0x000055555cc724e9 in pfs_spawn_thread (arg=0x614000140a60) at /home/wx/mysql-8.0.34/storage/perfschema/pfs.cc:3042
#23 0x00007ffff7568609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#24 0x00007ffff6bef133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
How to repeat:
Run the queries above.