Simple window function used together with IFNULL in the SELECT ... list leads to repeatable crash:
openxs@ao756:~/dbs/maria10.2$ bin/mysql -uroot test
|
Welcome to the MariaDB monitor. Commands end with ; or \g.
|
Your MariaDB connection id is 2
|
Server version: 10.2.2-MariaDB MariaDB Server
|
|
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
|
|
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
|
|
MariaDB [test]> create table t(a decimal(35,10), b int);
|
Query OK, 0 rows affected (0.28 sec)
|
|
MariaDB [test]> insert into t(a,b) values(1,1);
|
Query OK, 1 row affected (0.05 sec)
|
|
MariaDB [test]> insert into t(a,b) values(2,1);
|
Query OK, 1 row affected (0.04 sec)
|
|
MariaDB [test]> insert into t(a,b) values(0,1);
|
Query OK, 1 row affected (0.04 sec)
|
|
MariaDB [test]> select * from t;
|
+--------------+------+
|
| a | b |
|
+--------------+------+
|
| 1.0000000000 | 1 |
|
| 2.0000000000 | 1 |
|
| 0.0000000000 | 1 |
|
+--------------+------+
|
3 rows in set (0.00 sec)
|
|
MariaDB [test]> SELECT ifnull(((t.a) / CASE WHEN sum(t.a) over(partition by t.b) =0 then null else null end) ,0) from t;
|
ERROR 2013 (HY000): Lost connection to MySQL server during query
|
MariaDB [test]> 160826 17:30:16 mysqld_safe Number of processes running now: 0
|
160826 17:30:16 mysqld_safe mysqld restarted
|
|
MariaDB [test]> exit
|
Bye
|
openxs@ao756:~/dbs/maria10.2$ tail -100 data/ao756.err
|
2016-08-26 17:26:59 139788388034496 [Note] InnoDB: Completed initialization of buffer pool
|
2016-08-26 17:26:59 139788388034496 [Note] InnoDB: Highest supported file format is Barracuda.
|
2016-08-26 17:26:59 139788388034496 [Note] InnoDB: 128 rollback segment(s) are active.
|
2016-08-26 17:26:59 139788388034496 [Note] InnoDB: Waiting for purge to start
|
2016-08-26 17:26:59 139788388034496 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.30-76.3 started; log sequence number 1616819
|
2016-08-26 17:26:59 139787830806272 [Note] InnoDB: Dumping buffer pool(s) not yet started
|
2016-08-26 17:26:59 139788388034496 [Note] Plugin 'FEEDBACK' is disabled.
|
2016-08-26 17:26:59 139788388034496 [Note] Server socket created on IP: '::'.
|
2016-08-26 17:26:59 139788388034496 [Note] /home/openxs/dbs/maria10.2/bin/mysqld: ready for connections.
|
Version: '10.2.2-MariaDB' socket: '/tmp/mysql.sock' port: 3306 MariaDB Server
|
160826 17:30:16 [ERROR] mysqld got signal 11 ;
|
This could be because you hit a bug. It is also possible that this binary
|
or one of the libraries it was linked against is corrupt, improperly built,
|
or misconfigured. This error can also be caused by malfunctioning hardware.
|
|
To report this bug, see https://mariadb.com/kb/en/reporting-bugs
|
|
We will try our best to scrape up some info that will hopefully help
|
diagnose the problem, but since we have already crashed,
|
something is definitely wrong and this may fail.
|
|
Server version: 10.2.2-MariaDB
|
key_buffer_size=134217728
|
read_buffer_size=131072
|
max_used_connections=1
|
max_threads=153
|
thread_count=1
|
It is possible that mysqld could use up to
|
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 467161 K bytes of memory
|
Hope that's ok; if not, decrease some variables in the equation.
|
|
Thread pointer: 0x0x7f22d708a008
|
Attempting backtrace. You can use the following information to find out
|
where mysqld died. If you see no messages after this, something went
|
terribly wrong...
|
stack_bottom = 0x7f23052f69f0 thread_stack 0x48c00
|
/home/openxs/dbs/maria10.2/bin/mysqld(my_print_stacktrace+0x2e)[0x7f2304c0191e]
|
/home/openxs/dbs/maria10.2/bin/mysqld(handle_fatal_signal+0x38d)[0x7f230471013d]
|
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10330)[0x7f2303088330]
|
/home/openxs/dbs/maria10.2/bin/mysqld(_ZN4Item13save_in_fieldEP5Fieldb+0x1e6)[0x7f230471fc66]
|
/home/openxs/dbs/maria10.2/bin/mysqld(_Z31compute_window_func_with_framesP16Item_window_funcP5TABLEP11READ_RECORD+0x1a6)[0x7f23046a25f6]
|
/home/openxs/dbs/maria10.2/bin/mysqld(_ZN18Window_func_runner4execEP5TABLEP9SORT_INFO+0x7b)[0x7f23046a27fb]
|
/home/openxs/dbs/maria10.2/bin/mysqld(_ZN17Window_funcs_sort4execEP4JOIN+0x5b)[0x7f23046a288b]
|
/home/openxs/dbs/maria10.2/bin/mysqld(_ZN24Window_funcs_computation4execEP4JOIN+0x18)[0x7f23046a2e78]
|
/home/openxs/dbs/maria10.2/bin/mysqld(_ZN7AGGR_OP8end_sendEv+0xd7)[0x7f23045da667]
|
/home/openxs/dbs/maria10.2/bin/mysqld(_Z24sub_select_postjoin_aggrP4JOINP13st_join_tableb+0x35)[0x7f23045da865]
|
/home/openxs/dbs/maria10.2/bin/mysqld(_ZN4JOIN10exec_innerEv+0x845)[0x7f23045db165]
|
/home/openxs/dbs/maria10.2/bin/mysqld(_ZN4JOIN4execEv+0x33)[0x7f23045db523]
|
/home/openxs/dbs/maria10.2/bin/mysqld(_Z12mysql_selectP3THDP10TABLE_LISTjR4ListI4ItemEPS4_jP8st_orderS9_S7_S9_yP13select_resultP18st_select_lex_unitP13st_select_lex+0x112)[0x7f23045db672]
|
/home/openxs/dbs/maria10.2/bin/mysqld(_Z13handle_selectP3THDP3LEXP13select_resultm+0x23c)[0x7f23045dc12c]
|
/home/openxs/dbs/maria10.2/bin/mysqld(+0x46211e)[0x7f230457b11e]
|
mysys/stacktrace.c:247(my_print_stacktrace)[0x7f2304587dcc]
|
/home/openxs/dbs/maria10.2/bin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_statebb+0x2b5)[0x7f230458b515]
|
sql/item.cc:5956(Item::save_in_field(Field*, bool))[0x7f230458ed33]
|
sql/sql_window.cc:1753(compute_window_func_with_frames(Item_window_func*, TABLE*, READ_RECORD*))[0x7f230458f5ac]
|
/home/openxs/dbs/maria10.2/bin/mysqld(_Z24do_handle_one_connectionP7CONNECT+0x20a)[0x7f2304653a6a]
|
sql/sql_select.cc:26156(AGGR_OP::end_send())[0x7f2304653c2d]
|
/lib/x86_64-linux-gnu/libpthread.so.0(+0x8184)[0x7f2303080184]
|
sql/sql_parse.cc:6311(execute_sqlcom_select)[0x7f23027a337d]
|
|
Trying to get some variables.
|
Some pointers may be invalid and cause the dump to abort.
|
Query (0x7f22d70db020): SELECT ifnull(((t.a) / CASE WHEN sum(t.a) over(partition by t.b) =0 then null else null end) ,0) from t
|
Connection ID (thread ID): 2
|
Status: NOT_KILLED
|
|
Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=off
|
...
|
- relates to
-
MDEV-10815
Window Function Expressions Wrong Results
-
-
Closed
Valerii Kravchuk
made changes -
Field |
Original Value |
New Value |
Summary
|
Crash in SELECT with IFNULL and window function used
|
Crash in SELECT with window function used
|
Valerii Kravchuk
made changes -
Status
|
Open
[ 1
]
|
Confirmed
[ 10101
]
|
Valerii Kravchuk
made changes -
Priority
|
Major
[ 3
]
|
Critical
[ 2
]
|
Elena Stepanova
made changes -
Fix Version/s
|
|
10.2
[ 14601
]
|
Vicențiu Ciorbaru
made changes -
Status
|
Confirmed
[ 10101
]
|
In Progress
[ 3
]
|
Vicențiu Ciorbaru
made changes -
Assignee
|
Vicentiu Ciorbaru
[ cvicentiu
]
|
Sergei Petrunia
[ psergey
]
|
Status
|
In Progress
[ 3
]
|
In Review
[ 10002
]
|
Sergei Petrunia
made changes -
Fix Version/s
|
|
10.2.2
[ 22013
]
|
Fix Version/s
|
10.2
[ 14601
]
|
|
Resolution
|
|
Fixed
[ 1
]
|
Status
|
In Review
[ 10002
]
|
Closed
[ 6
]
|
Sergei Golubchik
made changes -
Workflow
|
MariaDB v3
[ 76811
]
|
MariaDB v4
[ 150823
]
|
{"report":{"fcp":1706.5999994277954,"ttfb":422.79999923706055,"pageVisibility":"visible","entityId":57806,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":32,"apdex":0.5,"journeyId":"104eda62-55a0-4b4b-90a1-8d6d1ee1a94d","navigationType":0,"readyForUser":1810.6999998092651,"redirectCount":0,"resourceLoadedEnd":2066.8999996185303,"resourceLoadedStart":428.8999996185303,"resourceTiming":[{"duration":729.6000003814697,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":428.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":428.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1158.5,"responseStart":0,"secureConnectionStart":0},{"duration":729.8000001907349,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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","startTime":429.0999994277954,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":429.0999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1158.8999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":738.1000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":429.29999923706055,"connectEnd":429.29999923706055,"connectStart":429.29999923706055,"domainLookupEnd":429.29999923706055,"domainLookupStart":429.29999923706055,"fetchStart":429.29999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":429.29999923706055,"responseEnd":1167.3999996185303,"responseStart":1167.3999996185303,"secureConnectionStart":429.29999923706055},{"duration":868.7999992370605,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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","startTime":429.5,"connectEnd":429.5,"connectStart":429.5,"domainLookupEnd":429.5,"domainLookupStart":429.5,"fetchStart":429.5,"redirectEnd":0,"redirectStart":0,"requestStart":429.5,"responseEnd":1298.2999992370605,"responseStart":1298.2999992370605,"secureConnectionStart":429.5},{"duration":887,"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":429.69999980926514,"connectEnd":429.69999980926514,"connectStart":429.69999980926514,"domainLookupEnd":429.69999980926514,"domainLookupStart":429.69999980926514,"fetchStart":429.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":429.69999980926514,"responseEnd":1316.6999998092651,"responseStart":1316.6999998092651,"secureConnectionStart":429.69999980926514},{"duration":887.3000001907349,"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":429.8999996185303,"connectEnd":429.8999996185303,"connectStart":429.8999996185303,"domainLookupEnd":429.8999996185303,"domainLookupStart":429.8999996185303,"fetchStart":429.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":429.8999996185303,"responseEnd":1317.1999998092651,"responseStart":1317.1999998092651,"secureConnectionStart":429.8999996185303},{"duration":888.6999998092651,"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":430.0999994277954,"connectEnd":430.0999994277954,"connectStart":430.0999994277954,"domainLookupEnd":430.0999994277954,"domainLookupStart":430.0999994277954,"fetchStart":430.0999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":430.0999994277954,"responseEnd":1318.7999992370605,"responseStart":1318.7999992370605,"secureConnectionStart":430.0999994277954},{"duration":891.4000005722046,"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":430.29999923706055,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":430.29999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1321.6999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":888.8999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":430.3999996185303,"connectEnd":430.3999996185303,"connectStart":430.3999996185303,"domainLookupEnd":430.3999996185303,"domainLookupStart":430.3999996185303,"fetchStart":430.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":430.3999996185303,"responseEnd":1319.2999992370605,"responseStart":1319.2999992370605,"secureConnectionStart":430.3999996185303},{"duration":891.3999996185303,"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":430.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":430.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1321.8999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":890,"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":430.69999980926514,"connectEnd":430.69999980926514,"connectStart":430.69999980926514,"domainLookupEnd":430.69999980926514,"domainLookupStart":430.69999980926514,"fetchStart":430.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":430.69999980926514,"responseEnd":1320.6999998092651,"responseStart":1320.6999998092651,"secureConnectionStart":430.69999980926514},{"duration":1075.4000005722046,"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":436.29999923706055,"connectEnd":436.29999923706055,"connectStart":436.29999923706055,"domainLookupEnd":436.29999923706055,"domainLookupStart":436.29999923706055,"fetchStart":436.29999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":436.29999923706055,"responseEnd":1511.6999998092651,"responseStart":1511.6999998092651,"secureConnectionStart":436.29999923706055},{"duration":1608.1999998092651,"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":436.8999996185303,"connectEnd":436.8999996185303,"connectStart":436.8999996185303,"domainLookupEnd":436.8999996185303,"domainLookupStart":436.8999996185303,"fetchStart":436.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":436.8999996185303,"responseEnd":2045.0999994277954,"responseStart":2045.0999994277954,"secureConnectionStart":436.8999996185303},{"duration":238.89999961853027,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1366.1999998092651,"connectEnd":1366.1999998092651,"connectStart":1366.1999998092651,"domainLookupEnd":1366.1999998092651,"domainLookupStart":1366.1999998092651,"fetchStart":1366.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":1366.1999998092651,"responseEnd":1605.0999994277954,"responseStart":1605.0999994277954,"secureConnectionStart":1366.1999998092651},{"duration":411.8999996185303,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":1654.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1654.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":2066.3999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":404.3999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":1655.5,"connectEnd":1655.5,"connectStart":1655.5,"domainLookupEnd":1655.5,"domainLookupStart":1655.5,"fetchStart":1655.5,"redirectEnd":0,"redirectStart":0,"requestStart":1655.5,"responseEnd":2059.8999996185303,"responseStart":2059.8999996185303,"secureConnectionStart":1655.5},{"duration":410.8999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/s/097ae97cb8fbec7d6ea4bbb1f26955b9-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":1656,"connectEnd":1656,"connectStart":1656,"domainLookupEnd":1656,"domainLookupStart":1656,"fetchStart":1656,"redirectEnd":0,"redirectStart":0,"requestStart":1656,"responseEnd":2066.8999996185303,"responseStart":2066.8999996185303,"secureConnectionStart":1656}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":220,"responseStart":422,"responseEnd":436,"domLoading":426,"domInteractive":2078,"domContentLoadedEventStart":2078,"domContentLoadedEventEnd":2139,"domComplete":3031,"loadEventStart":3031,"loadEventEnd":3032,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":2047},{"name":"bigPipe.sidebar-id.end","time":2047.8999996185303},{"name":"bigPipe.activity-panel-pipe-id.start","time":2048.0999994277954},{"name":"bigPipe.activity-panel-pipe-id.end","time":2051.2999992370605},{"name":"activityTabFullyLoaded","time":2156.5999994277954}],"measures":[],"correlationId":"fbdf2fa274a369","effectiveType":"4g","downlink":9.5,"rtt":0,"serverDuration":131,"dbReadsTimeInMs":21,"dbConnsTimeInMs":30,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}