The following use case crashes with window functions:
create table t1(i int);
|
insert into t1 values (1),(2);
|
|
select interval(sum(i) over (order by i), 10, 20) from t1; # Crash happens here.
|
drop table t1;
|
Thread 1 (Thread 0x7f4335af3700 (LWP 30528)):
|
#0 __pthread_kill (threadid=<optimized out>, signo=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:62
|
#1 0x000000000127e99b in my_write_core (sig=11) at /home/vicentiu/Workspace/MariaDB-10.2/mysys/stacktrace.c:477
|
#2 0x00000000009c7b00 in handle_fatal_signal (sig=11) at /home/vicentiu/Workspace/MariaDB-10.2/sql/signal_handler.cc:299
|
#3 <signal handler called>
|
#4 Field::set_notnull (this=0x0, row_offset=0) at /home/vicentiu/Workspace/MariaDB-10.2/sql/field.h:1131
|
#5 0x00000000009f59a1 in Item::save_in_field (this=0x7f4324012900, field=0x0, no_conversions=true) at /home/vicentiu/Workspace/MariaDB-10.2/sql/item.cc:6399
|
#6 0x00000000008f90f3 in save_window_function_values (window_functions=..., tbl=0x7f4324185d68, rowid_buf=0x7f4324080fe0 "\020\226\016$C\177") at /home/vicentiu/Workspace/MariaDB-10.2/sql/sql_window.cc:2524
|
#7 0x00000000008f8f43 in compute_window_func (thd=0x7f4324000b00, window_functions=..., cursor_managers=..., tbl=0x7f4324185d68, filesort_result=0x7f4324187a80) at /home/vicentiu/Workspace/MariaDB-10.2/sql/sql_window.cc:2643
|
#8 0x00000000008f938f in Window_func_runner::exec (this=0x7f43240158e0, thd=0x7f4324000b00, tbl=0x7f4324185d68, filesort_result=0x7f4324187a80) at /home/vicentiu/Workspace/MariaDB-10.2/sql/sql_window.cc:2746
|
#9 0x00000000008f9505 in Window_funcs_sort::exec (this=0x7f43240158d8, join=0x7f43240134e0) at /home/vicentiu/Workspace/MariaDB-10.2/sql/sql_window.cc:2774
|
#10 0x00000000008f9efa in Window_funcs_computation::exec (this=0x7f43240158b8, join=0x7f43240134e0) at /home/vicentiu/Workspace/MariaDB-10.2/sql/sql_window.cc:2893
|
#11 0x0000000000776074 in AGGR_OP::end_send (this=0x7f4324015698) at /home/vicentiu/Workspace/MariaDB-10.2/sql/sql_select.cc:26358
|
#12 0x00000000007599ee in sub_select_postjoin_aggr (join=0x7f43240134e0, join_tab=0x7f43240149e8, end_of_records=true) at /home/vicentiu/Workspace/MariaDB-10.2/sql/sql_select.cc:18203
|
#13 0x0000000000776332 in sub_select (join=0x7f43240134e0, join_tab=0x7f4324014638, end_of_records=true) at /home/vicentiu/Workspace/MariaDB-10.2/sql/sql_select.cc:18439
|
#14 0x00000000007600f6 in do_select (join=0x7f43240134e0, procedure=0x0) at /home/vicentiu/Workspace/MariaDB-10.2/sql/sql_select.cc:18034
|
#15 0x000000000075ef27 in JOIN::exec_inner (this=0x7f43240134e0) at /home/vicentiu/Workspace/MariaDB-10.2/sql/sql_select.cc:3473
|
#16 0x000000000075e10e in JOIN::exec (this=0x7f43240134e0) at /home/vicentiu/Workspace/MariaDB-10.2/sql/sql_select.cc:3274
|
#17 0x000000000073bd8c in mysql_select (thd=0x7f4324000b00, tables=0x7f4324012dd0, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f43240134c0, unit=0x7f43240045e0, select_lex=0x7f4324004d18) at /home/vicentiu/Workspace/MariaDB-10.2/sql/sql_select.cc:3668
|
#18 0x000000000073b5ec in handle_select (thd=0x7f4324000b00, lex=0x7f4324004518, result=0x7f43240134c0, setup_tables_done_option=0) at /home/vicentiu/Workspace/MariaDB-10.2/sql/sql_select.cc:361
|
#19 0x00000000006fe1b3 in execute_sqlcom_select (thd=0x7f4324000b00, all_tables=0x7f4324012dd0) at /home/vicentiu/Workspace/MariaDB-10.2/sql/sql_parse.cc:6438
|
#20 0x00000000006f148c in mysql_execute_command (thd=0x7f4324000b00) at /home/vicentiu/Workspace/MariaDB-10.2/sql/sql_parse.cc:3453
|
#21 0x00000000006ed32a in mysql_parse (thd=0x7f4324000b00, rawbuf=0x7f4324012368 "select interval(sum(i) over (order by i), 10, 20) from t1", length=57, parser_state=0x7f4335af13d8, is_com_multi=false, is_next_command=false) at /home/vicentiu/Workspace/MariaDB-10.2/sql/sql_parse.cc:7875
|
#22 0x00000000006e8380 in dispatch_command (command=COM_QUERY, thd=0x7f4324000b00, packet=0x7f43240dfbe1 "", packet_length=57, is_com_multi=false, is_next_command=false) at /home/vicentiu/Workspace/MariaDB-10.2/sql/sql_parse.cc:1816
|
#23 0x00000000006ebada in do_command (thd=0x7f4324000b00) at /home/vicentiu/Workspace/MariaDB-10.2/sql/sql_parse.cc:1361
|
#24 0x0000000000872ac1 in do_handle_one_connection (connect=0x2ff5ff0) at /home/vicentiu/Workspace/MariaDB-10.2/sql/sql_connect.cc:1354
|
#25 0x000000000087289a in handle_one_connection (arg=0x2ff5ff0) at /home/vicentiu/Workspace/MariaDB-10.2/sql/sql_connect.cc:1260
|
#26 0x00000000010b64b4 in pfs_spawn_thread (arg=0x3019330) at /home/vicentiu/Workspace/MariaDB-10.2/storage/perfschema/pfs.cc:1862
|
#27 0x00007f433e7d86ba in start_thread (arg=0x7f4335af3700) at pthread_create.c:333
|
#28 0x00007f433c2ac82d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
|
{"report":{"fcp":880.0999999046326,"ttfb":210.20000004768372,"pageVisibility":"visible","entityId":61949,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"bca8b260-f1ff-4255-aa31-05a281390e6d","navigationType":0,"readyForUser":958.2000000476837,"redirectCount":0,"resourceLoadedEnd":1124.5999999046326,"resourceLoadedStart":216.70000004768372,"resourceTiming":[{"duration":164.19999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":216.70000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":216.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":380.89999985694885,"responseStart":0,"secureConnectionStart":0},{"duration":164.40000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":216.89999985694885,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":216.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":381.2999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":173.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":217.09999990463257,"connectEnd":217.09999990463257,"connectStart":217.09999990463257,"domainLookupEnd":217.09999990463257,"domainLookupStart":217.09999990463257,"fetchStart":217.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":217.09999990463257,"responseEnd":390.59999990463257,"responseStart":390.59999990463257,"secureConnectionStart":217.09999990463257},{"duration":224,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":217.29999995231628,"connectEnd":217.29999995231628,"connectStart":217.29999995231628,"domainLookupEnd":217.29999995231628,"domainLookupStart":217.29999995231628,"fetchStart":217.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":217.29999995231628,"responseEnd":441.2999999523163,"responseStart":441.2999999523163,"secureConnectionStart":217.29999995231628},{"duration":227.79999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":217.5,"connectEnd":217.5,"connectStart":217.5,"domainLookupEnd":217.5,"domainLookupStart":217.5,"fetchStart":217.5,"redirectEnd":0,"redirectStart":0,"requestStart":217.5,"responseEnd":445.2999999523163,"responseStart":445.2999999523163,"secureConnectionStart":217.5},{"duration":229.39999985694885,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":217.70000004768372,"connectEnd":217.70000004768372,"connectStart":217.70000004768372,"domainLookupEnd":217.70000004768372,"domainLookupStart":217.70000004768372,"fetchStart":217.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":217.70000004768372,"responseEnd":447.09999990463257,"responseStart":447.09999990463257,"secureConnectionStart":217.70000004768372},{"duration":230.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":217.89999985694885,"connectEnd":217.89999985694885,"connectStart":217.89999985694885,"domainLookupEnd":217.89999985694885,"domainLookupStart":217.89999985694885,"fetchStart":217.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":217.89999985694885,"responseEnd":448.59999990463257,"responseStart":448.59999990463257,"secureConnectionStart":217.89999985694885},{"duration":316.39999985694885,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":218,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":218,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":534.3999998569489,"responseStart":0,"secureConnectionStart":0},{"duration":231.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":218.20000004768372,"connectEnd":218.20000004768372,"connectStart":218.20000004768372,"domainLookupEnd":218.20000004768372,"domainLookupStart":218.20000004768372,"fetchStart":218.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":218.20000004768372,"responseEnd":449.39999985694885,"responseStart":449.39999985694885,"secureConnectionStart":218.20000004768372},{"duration":316.2000000476837,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":218.39999985694885,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":218.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":534.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":232.10000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":218.59999990463257,"connectEnd":218.59999990463257,"connectStart":218.59999990463257,"domainLookupEnd":218.59999990463257,"domainLookupStart":218.59999990463257,"fetchStart":218.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":218.59999990463257,"responseEnd":450.7000000476837,"responseStart":450.7000000476837,"secureConnectionStart":218.59999990463257},{"duration":496.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":224,"connectEnd":224,"connectStart":224,"domainLookupEnd":224,"domainLookupStart":224,"fetchStart":224,"redirectEnd":0,"redirectStart":0,"requestStart":224,"responseEnd":720.0999999046326,"responseStart":720.0999999046326,"secureConnectionStart":224},{"duration":900.3999998569489,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":224.20000004768372,"connectEnd":224.20000004768372,"connectStart":224.20000004768372,"domainLookupEnd":224.20000004768372,"domainLookupStart":224.20000004768372,"fetchStart":224.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":224.20000004768372,"responseEnd":1124.5999999046326,"responseStart":1124.5999999046326,"secureConnectionStart":224.20000004768372},{"duration":174.09999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":546.7000000476837,"connectEnd":546.7000000476837,"connectStart":546.7000000476837,"domainLookupEnd":546.7000000476837,"domainLookupStart":546.7000000476837,"fetchStart":546.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":546.7000000476837,"responseEnd":720.7999999523163,"responseStart":720.7999999523163,"secureConnectionStart":546.7000000476837}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":58,"responseStart":210,"responseEnd":221,"domLoading":213,"domInteractive":1144,"domContentLoadedEventStart":1144,"domContentLoadedEventEnd":1184,"domComplete":1647,"loadEventStart":1647,"loadEventEnd":1647,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1127.2999999523163},{"name":"bigPipe.sidebar-id.end","time":1128.2000000476837},{"name":"bigPipe.activity-panel-pipe-id.start","time":1128.2999999523163},{"name":"bigPipe.activity-panel-pipe-id.end","time":1129.5999999046326},{"name":"activityTabFullyLoaded","time":1197.2000000476837}],"measures":[],"correlationId":"63c766c11e2b2b","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":88,"dbReadsTimeInMs":9,"dbConnsTimeInMs":16,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
This might be related to
MDEV-12851. Item_func_interval is not updated for window function usage.