|
CREATE TABLE t0 (a INT,PRIMARY KEY(a));
|
SELECT (SELECT a FROM (SELECT 0 FROM t0) e ORDER BY (@f:=a)) FROM t0 GROUP BY a;
|
Leads to:
|
10.8.0 bc57ff7cf79504a198d4752b4748340a4afd886c (Debug)
|
mysqld: /test/10.8_dbg/sql/item.cc:5517: Item** resolve_ref_in_select_and_group(THD*, Item_ident*, SELECT_LEX*): Assertion `(*select_ref)->fixed()' failed.
|
|
10.8.0 bc57ff7cf79504a198d4752b4748340a4afd886c (Debug)
|
Core was generated by `/test/MD121121-mariadb-10.8.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
|
Program terminated with signal SIGABRT, Aborted.
|
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
|
[Current thread is 1 (Thread 0x14964868b700 (LWP 85041))]
|
(gdb) bt
|
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
|
#1 0x000014964c26a859 in __GI_abort () at abort.c:79
|
#2 0x000014964c26a729 in __assert_fail_base (fmt=0x14964c400588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x56499692cd89 "(*select_ref)->fixed()", file=0x56499692cb7c "/test/10.8_dbg/sql/item.cc", line=5517, function=<optimized out>) at assert.c:92
|
#3 0x000014964c27bf36 in __GI___assert_fail (assertion=assertion@entry=0x56499692cd89 "(*select_ref)->fixed()", file=file@entry=0x56499692cb7c "/test/10.8_dbg/sql/item.cc", line=line@entry=5517, function=function@entry=0x56499692e0e0 "Item** resolve_ref_in_select_and_group(THD*, Item_ident*, SELECT_LEX*)") at assert.c:101
|
#4 0x0000564995de6a26 in resolve_ref_in_select_and_group (thd=thd@entry=0x149600000db8, ref=ref@entry=0x149600026fa8, select=<optimized out>) at /test/10.8_dbg/sql/item.h:1069
|
#5 0x0000564995dfd011 in Item_ref::fix_fields (this=0x149600026fa8, thd=0x149600000db8, reference=0x1496486890b8) at /test/10.8_dbg/sql/item.cc:7997
|
#6 0x0000564995dfc715 in Item_field::fix_fields (this=0x149600016c70, thd=0x149600000db8, reference=0x149600016e00) at /test/10.8_dbg/sql/item.cc:6072
|
#7 0x0000564995e50f2e in Item::fix_fields_if_needed (ref=0x149600016e00, thd=0x149600000db8, this=<optimized out>) at /test/10.8_dbg/sql/item.h:1144
|
#8 Item_func::fix_fields (this=this@entry=0x149600016d88, thd=thd@entry=0x149600000db8, ref=ref@entry=0x149600016f08) at /test/10.8_dbg/sql/item_func.cc:347
|
#9 0x0000564995e6c540 in Item_func_set_user_var::fix_fields (this=0x149600016d88, thd=0x149600000db8, ref=0x149600016f08) at /test/10.8_dbg/sql/item_func.cc:4714
|
#10 0x0000564995b0d7b2 in Item::fix_fields_if_needed (ref=<optimized out>, thd=0x149600000db8, this=0x149600016d88) at /test/10.8_dbg/sql/item.h:1156
|
#11 Item::fix_fields_if_needed_for_scalar (ref=<optimized out>, thd=0x149600000db8, this=0x149600016d88) at /test/10.8_dbg/sql/item.h:1148
|
#12 Item::fix_fields_if_needed_for_order_by (ref=<optimized out>, thd=0x149600000db8, this=0x149600016d88) at /test/10.8_dbg/sql/item.h:1156
|
#13 find_order_in_list (thd=thd@entry=0x149600000db8, ref_pointer_array=<optimized out>, tables=tables@entry=0x149600015d68, order=order@entry=0x149600016ef8, fields=@0x1496000145e0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1496000148d8, last = 0x1496000148d8, elements = 1}, <No data fields>}, all_fields=@0x149600026318: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1496000148d8, last = 0x1496000148d8, elements = 1}, <No data fields>}, is_group_field=false, add_to_all_fields=true, from_window_spec=false) at /test/10.8_dbg/sql/sql_select.cc:24987
|
#14 0x0000564995b3c3a3 in setup_order (thd=thd@entry=0x149600000db8, ref_pointer_array=<optimized out>, tables=tables@entry=0x149600015d68, fields=@0x1496000145e0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1496000148d8, last = 0x1496000148d8, elements = 1}, <No data fields>}, all_fields=@0x149600026318: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1496000148d8, last = 0x1496000148d8, elements = 1}, <No data fields>}, order=0x149600016ef8, from_window_spec=false) at /test/10.8_dbg/sql/sql_select.cc:25034
|
#15 0x0000564995b40c7e in setup_without_group (reserved=<optimized out>, hidden_group_fields=0x1496000262c7, win_funcs=<optimized out>, win_specs=<optimized out>, group=<optimized out>, order=<optimized out>, conds=0x149600026400, all_fields=@0x149600026318: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1496000148d8, last = 0x1496000148d8, elements = 1}, <No data fields>}, fields=<optimized out>, leaves=<optimized out>, tables=<optimized out>, ref_pointer_array=<optimized out>, thd=<optimized out>) at /test/10.8_dbg/sql/sql_select.cc:849
|
#16 JOIN::prepare (this=0x149600025fb0, tables_init=<optimized out>, conds_init=<optimized out>, og_num=<optimized out>, order_init=<optimized out>, skip_order_by=skip_order_by@entry=false, group_init=<optimized out>, having_init=<optimized out>, proc_param_init=<optimized out>, select_lex_arg=<optimized out>, unit_arg=<optimized out>) at /test/10.8_dbg/sql/sql_select.cc:1403
|
#17 0x0000564995ede0df in subselect_single_select_engine::prepare (this=0x149600017108, thd=0x149600000db8) at /test/10.8_dbg/sql/sql_lex.h:1363
|
#18 0x0000564995edd503 in Item_subselect::fix_fields (this=0x149600016f80, thd_param=<optimized out>, ref=0x149600017150) at /test/10.8_dbg/sql/item_subselect.cc:295
|
#19 0x0000564995a3230c in Item::fix_fields_if_needed (ref=0x149600017150, thd=0x149600000db8, this=0x149600016f80) at /test/10.8_dbg/sql/item.h:1148
|
#20 Item::fix_fields_if_needed_for_scalar (ref=0x149600017150, thd=0x149600000db8, this=0x149600016f80) at /test/10.8_dbg/sql/item.h:1148
|
#21 setup_fields (thd=0x149600000db8, ref_pointer_array=<optimized out>, fields=<optimized out>, column_usage=column_usage@entry=MARK_COLUMNS_READ, sum_func_list=sum_func_list@entry=0x149600025d50, pre_fix=0x149600014180, allow_sum_func=true) at /test/10.8_dbg/sql/sql_base.cc:7716
|
#22 0x0000564995b408ab in JOIN::prepare (this=this@entry=0x1496000259e8, tables_init=tables_init@entry=0x149600017230, conds_init=conds_init@entry=0x0, og_num=og_num@entry=1, order_init=order_init@entry=0x0, skip_order_by=skip_order_by@entry=false, group_init=0x149600017a48, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x149600013ec8, unit_arg=0x1496000051c0) at /test/10.8_dbg/sql/sql_select.cc:1397
|
#23 0x0000564995b59acf in mysql_select (thd=thd@entry=0x149600000db8, tables=0x149600017230, fields=@0x149600014168: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x149600017148, last = 0x149600017148, elements = 1}, <No data fields>}, conds=0x0, og_num=1, order=0x0, group=0x149600017a48, having=0x0, proc_param=0x0, select_options=2147748608, result=0x149600017bf8, unit=0x1496000051c0, select_lex=0x149600013ec8) at /test/10.8_dbg/sql/sql_select.cc:4968
|
#24 0x0000564995b59df6 in handle_select (thd=thd@entry=0x149600000db8, lex=lex@entry=0x1496000050e8, result=result@entry=0x149600017bf8, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.8_dbg/sql/sql_select.cc:545
|
#25 0x0000564995ab8abc in execute_sqlcom_select (thd=thd@entry=0x149600000db8, all_tables=0x149600017230) at /test/10.8_dbg/sql/sql_parse.cc:6253
|
#26 0x0000564995ac59e3 in mysql_execute_command (thd=thd@entry=0x149600000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.8_dbg/sql/sql_parse.cc:3944
|
#27 0x0000564995ab1cad in mysql_parse (thd=thd@entry=0x149600000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14964868a400) at /test/10.8_dbg/sql/sql_parse.cc:8028
|
#28 0x0000564995ac0949 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x149600000db8, packet=packet@entry=0x14960000b879 "SELECT (SELECT a FROM (SELECT 0 FROM t0) e ORDER BY (@f:=a)) FROM t0 GROUP BY a", packet_length=packet_length@entry=79, blocking=blocking@entry=true) at /test/10.8_dbg/sql/sql_class.h:1360
|
#29 0x0000564995ac3d83 in do_command (thd=0x149600000db8, blocking=blocking@entry=true) at /test/10.8_dbg/sql/sql_parse.cc:1402
|
#30 0x0000564995c3de2a in do_handle_one_connection (connect=<optimized out>, connect@entry=0x564999718f38, put_in_cache=put_in_cache@entry=true) at /test/10.8_dbg/sql/sql_connect.cc:1418
|
#31 0x0000564995c3e42f in handle_one_connection (arg=arg@entry=0x564999718f38) at /test/10.8_dbg/sql/sql_connect.cc:1312
|
#32 0x00005649960be4ce in pfs_spawn_thread (arg=0x56499962d568) at /test/10.8_dbg/storage/perfschema/pfs.cc:2201
|
#33 0x000014964c779609 in start_thread (arg=<optimized out>) at pthread_create.c:477
|
#34 0x000014964c367293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
|
Bug confirmed present in:
MariaDB: 10.2.42 (dbg), 10.3.33 (dbg), 10.4.23 (dbg), 10.5.14 (dbg), 10.6.6 (dbg), 10.7.2 (dbg), 10.8.0 (dbg)
MySQL: 5.5.62 (dbg)
Bug (or feature/syntax) confirmed not present in:
MariaDB: 10.2.42 (opt), 10.3.33 (opt), 10.4.23 (opt), 10.5.14 (opt), 10.6.6 (opt), 10.7.2 (opt), 10.8.0 (opt)
MySQL: 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.36 (dbg), 5.7.36 (opt), 8.0.27 (dbg), 8.0.27 (opt)
|