[MDEV-20592] window functions crash Created: 2019-09-14  Updated: 2019-09-16  Resolved: 2019-09-16

Status: Closed
Project: MariaDB Server
Component/s: Optimizer - Window functions
Affects Version/s: 10.4.8
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: sbester1 Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Environment:

Windows x64


Issue Links:
Duplicate
duplicates MDEV-15180 server crashed with NTH_VALUE() Closed

 Description   

Version: '10.4.8-MariaDB'  socket: ''  port: 3306  mariadb.org binary distribution
[ERROR] mysqld got exception 0xc0000005 ;
terribly wrong...
mysqld.exe!Item_field::used_tables()[item.cc:3324]
mysqld.exe!Item_window_func::update_used_tables()[item_windowfunc.cc:73]
mysqld.exe!Item_sum::update_used_tables()[item_sum.cc:553]
mysqld.exe!Item_sum::check_sum_func()[item_sum.cc:321]
mysqld.exe!Item_sum_hybrid_simple::fix_fields()[item_windowfunc.cc:365]
mysqld.exe!Item_window_func::fix_fields()[item_windowfunc.cc:118]
mysqld.exe!setup_fields()[sql_base.cc:7640]
mysqld.exe!JOIN::prepare()[sql_select.cc:1198]
mysqld.exe!mysql_select()[sql_select.cc:4568]
mysqld.exe!handle_select()[sql_select.cc:413]
mysqld.exe!execute_sqlcom_select()[sql_parse.cc:6357]
mysqld.exe!mysql_execute_command()[sql_parse.cc:3899]
mysqld.exe!mysql_parse()[sql_parse.cc:7914]
mysqld.exe!dispatch_command()[sql_parse.cc:1845]
mysqld.exe!do_command()[sql_parse.cc:1359]
mysqld.exe!threadpool_process_request()[threadpool_common.cc:366]
mysqld.exe!tp_callback()[threadpool_common.cc:193]

How to Repeat:

 drop table if exists t;
 create table t(a int) engine=innodb;
 select ntile(5) over(), 
  last_value(std(0) over(w2 partition by a)) 
  over(order by a) 
 from t window w1 as (w2 order by a);



 Comments   
Comment by Alice Sherepa [ 2019-09-16 ]

seems to be the same as MDEV-15180

10.2 3793da44cff600843384d

#3  <signal handler called>
#4  0x000055abe0b18b43 in Item_field::used_tables (this=0x7f72c0012b40) at /10.2/sql/item.cc:2942
#5  0x000055abe0cee4d6 in Item_window_func::update_used_tables (this=0x7f72c0012d10) at /10.2/sql/item_windowfunc.cc:58
#6  0x000055abe0bd76d3 in Item_sum::update_used_tables (this=0x7f72c0012df0) at /10.2/sql/item_sum.cc:545
#7  0x000055abe0bd6b6c in Item_sum::check_sum_func (this=0x7f72c0012df0, thd=0x7f72c0000b00, ref=0x7f72c00131e8) at /10.2/sql/item_sum.cc:312
#8  0x000055abe0ceefc1 in Item_sum_hybrid_simple::fix_fields (this=0x7f72c0012df0, thd=0x7f72c0000b00, ref=0x7f72c00131e8) at /10.2/sql/item_windowfunc.cc:275
#9  0x000055abe0cee77a in Item_window_func::fix_fields (this=0x7f72c0013100, thd=0x7f72c0000b00, ref=0x7f72c00131e8) at /10.2/sql/item_windowfunc.cc:102
#10 0x000055abe08134aa in setup_fields (thd=0x7f72c0000b00, ref_pointer_array=..., fields=..., mark_used_columns=MARK_COLUMNS_READ, sum_func_list=0x7f72c0013f18, pre_fix=0x7f72c0004f80, allow_sum_func=true) at /10.2/sql/sql_base.cc:7204
#11 0x000055abe08bb14f in JOIN::prepare (this=0x7f72c0013bf8, tables_init=0x7f72c00132e0, wild_num=0, conds_init=0x0, og_num=0, order_init=0x0, skip_order_by=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x7f72c0004e40, unit_arg=0x7f72c0004700) at /10.2/sql/sql_select.cc:811
#12 0x000055abe08c5ad4 in mysql_select (thd=0x7f72c0000b00, tables=0x7f72c00132e0, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f72c0013bd8, unit=0x7f72c0004700, select_lex=0x7f72c0004e40) at /10.2/sql/sql_select.cc:3796
#13 0x000055abe08b9dde in handle_select (thd=0x7f72c0000b00, lex=0x7f72c0004638, result=0x7f72c0013bd8, setup_tables_done_option=0) at /10.2/sql/sql_select.cc:373
#14 0x000055abe0884d7d in execute_sqlcom_select (thd=0x7f72c0000b00, all_tables=0x7f72c00132e0) at /10.2/sql/sql_parse.cc:6225
#15 0x000055abe087b768 in mysql_execute_command (thd=0x7f72c0000b00) at /10.2/sql/sql_parse.cc:3532
#16 0x000055abe0888c09 in mysql_parse (thd=0x7f72c0000b00, rawbuf=0x7f72c0012468 "select ntile(5) over(),  last_value(std(0) over(w2 partition by a))  over(order by a) \nfrom t window w1 as (w2 order by a)", length=122, parser_state=0x7f731407c080, is_com_multi=false, is_next_command=false) at /10.2/sql/sql_parse.cc:7759
#17 0x000055abe0876ecc in dispatch_command (command=COM_QUERY, thd=0x7f72c0000b00, packet=0x7f72c00961e1 "select ntile(5) over(),  last_value(std(0) over(w2 partition by a))  over(order by a) \nfrom t window w1 as (w2 order by a)", packet_length=122, is_com_multi=false, is_next_command=false) at /10.2/sql/sql_parse.cc:1831
#18 0x000055abe08757e0 in do_command (thd=0x7f72c0000b00) at /10.2/sql/sql_parse.cc:1385
#19 0x000055abe09cb749 in do_handle_one_connection (connect=0x55abe39d9d50) at /10.2/sql/sql_connect.cc:1336
#20 0x000055abe09cb4b4 in handle_one_connection (arg=0x55abe39d9d50) at /10.2/sql/sql_connect.cc:1241
#21 0x000055abe11f8196 in pfs_spawn_thread (arg=0x55abe39e4b40) at /10.2/storage/perfschema/pfs.cc:1862
#22 0x00007f731a64d6ba in start_thread (arg=0x7f731407d700) at pthread_create.c:333
#23 0x00007f7319ae241d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Generated at Thu Feb 08 09:00:40 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.