When running a query on spider table with "WHERE NULL" (or for example where JSON function that returns NULL) Mariadb crashes.
Simple reproduce:
FROM mariadb:10.3
|
|
RUN apt update && apt install -y mariadb-plugin-spider
|
RUN cp /usr/share/mysql/install_spider.sql /docker-entrypoint-initdb.d/
|
Launching docker with "mariadb:10.3" and running the next queries:
CREATE DATABASE test;
|
USE test;
|
|
CREATE TABLE `test` (
|
id INT
|
);
|
Launching a docker with the dockerfile above and running the next queries:
CREATE DATABASE test;
|
CREATE SERVER node1 FOREIGN DATA WRAPPER mysql OPTIONS(HOST "node1", USER "root", PORT 3306, DATABASE "test");
|
|
USE test;
|
CREATE TABLE `test` ENGINE=SPIDER COMMENT='wrapper "mysql", srv "node1", table "test"';
|
SELECT * FROM test WHERE NULL;
|
The last query will cause mariadb to crash with the next message:
190411 11:59:28 [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.3.13-MariaDB-1:10.3.13+maria~bionic
|
key_buffer_size=134217728
|
read_buffer_size=2097152
|
max_used_connections=1
|
max_threads=102
|
thread_count=27
|
It is possible that mysqld could use up to
|
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 760012 K bytes of memory
|
Hope that's ok; if not, decrease some variables in the equation.
|
|
Thread pointer: 0x7fe608000c08
|
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 = 0x7fe6d023ddd8 thread_stack 0x49000
|
mysqld(my_print_stacktrace+0x2e)[0x55cf8e4ee47e]
|
mysqld(handle_fatal_signal+0x5a5)[0x55cf8df8e295]
|
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12890)[0x7fe6e5691890]
|
mysqld(_ZN4JOIN21make_aggr_tables_infoEv+0x8b5)[0x55cf8ddfd235]
|
mysqld(_ZN4JOIN15optimize_stage2Ev+0xc4)[0x55cf8de03744]
|
mysqld(_ZN4JOIN14optimize_innerEv+0xe69)[0x55cf8de06889]
|
mysqld(_ZN4JOIN8optimizeEv+0x37)[0x55cf8de082f7]
|
mysqld(_Z12mysql_selectP3THDP10TABLE_LISTjR4ListI4ItemEPS4_jP8st_orderS9_S7_S9_yP13select_resultP18st_select_lex_unitP13st_select_lex+0x856)[0x55cf8de0a126]
|
mysqld(_Z13handle_selectP3THDP3LEXP13select_resultm+0x14d)[0x55cf8de0a32d]
|
mysqld(+0x564661)[0x55cf8ddab661]
|
mysqld(_Z21mysql_execute_commandP3THD+0x5ec2)[0x55cf8ddb7e82]
|
mysqld(_Z11mysql_parseP3THDPcjP12Parser_statebb+0x20a)[0x55cf8ddbaa4a]
|
mysqld(_Z16dispatch_command19enum_server_commandP3THDPcjbb+0x1cc7)[0x55cf8ddbd447]
|
mysqld(_Z10do_commandP3THD+0x178)[0x55cf8ddbe1e8]
|
mysqld(_Z24do_handle_one_connectionP7CONNECT+0x212)[0x55cf8de8dd92]
|
mysqld(handle_one_connection+0x3d)[0x55cf8de8df6d]
|
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76db)[0x7fe6e56866db]
|
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f)[0x7fe6e4c8888f]
|
|
Trying to get some variables.
|
Some pointers may be invalid and cause the dump to abort.
|
Query (0x7fe608011bc0): select * from test where null
|
Connection ID (thread ID): 31
|
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=on,condition_pushdown_for_derived=on,split_materialized=on
|
|
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
|
information that should help you find out what is causing the crash.
|
{"report":{"fcp":824.7000000476837,"ttfb":185.90000009536743,"pageVisibility":"visible","entityId":75317,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"e6a19c01-a9b6-41a4-a83d-8eede96bf661","navigationType":0,"readyForUser":907.7000000476837,"redirectCount":0,"resourceLoadedEnd":563.6000001430511,"resourceLoadedStart":195.40000009536743,"resourceTiming":[{"duration":23.799999952316284,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":195.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":195.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":219.20000004768372,"responseStart":0,"secureConnectionStart":0},{"duration":23.799999952316284,"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":195.60000014305115,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":195.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":219.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":227.79999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":195.80000019073486,"connectEnd":195.80000019073486,"connectStart":195.80000019073486,"domainLookupEnd":195.80000019073486,"domainLookupStart":195.80000019073486,"fetchStart":195.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":228,"responseEnd":423.60000014305115,"responseStart":254.5,"secureConnectionStart":195.80000019073486},{"duration":367.5,"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":196.10000014305115,"connectEnd":223.60000014305115,"connectStart":223.60000014305115,"domainLookupEnd":223.60000014305115,"domainLookupStart":223.60000014305115,"fetchStart":196.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":225.60000014305115,"responseEnd":563.6000001430511,"responseStart":243.60000014305115,"secureConnectionStart":223.60000014305115},{"duration":50.5,"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":196.20000004768372,"connectEnd":196.20000004768372,"connectStart":196.20000004768372,"domainLookupEnd":196.20000004768372,"domainLookupStart":196.20000004768372,"fetchStart":196.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":228.5,"responseEnd":246.70000004768372,"responseStart":245.10000014305115,"secureConnectionStart":196.20000004768372},{"duration":53.200000047683716,"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":196.40000009536743,"connectEnd":196.40000009536743,"connectStart":196.40000009536743,"domainLookupEnd":196.40000009536743,"domainLookupStart":196.40000009536743,"fetchStart":196.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":229,"responseEnd":249.60000014305115,"responseStart":246.20000004768372,"secureConnectionStart":196.40000009536743},{"duration":56.5,"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":196.60000014305115,"connectEnd":196.60000014305115,"connectStart":196.60000014305115,"domainLookupEnd":196.60000014305115,"domainLookupStart":196.60000014305115,"fetchStart":196.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":229.20000004768372,"responseEnd":253.10000014305115,"responseStart":249.80000019073486,"secureConnectionStart":196.60000014305115},{"duration":28.699999809265137,"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":196.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":196.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":225.5,"responseStart":0,"secureConnectionStart":0},{"duration":56.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":197,"connectEnd":197,"connectStart":197,"domainLookupEnd":197,"domainLookupStart":197,"fetchStart":197,"redirectEnd":0,"redirectStart":0,"requestStart":229.60000014305115,"responseEnd":253.5,"responseStart":250.5,"secureConnectionStart":197},{"duration":29.700000047683716,"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":197.20000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":197.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":226.90000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":59.19999980926514,"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":197.30000019073486,"connectEnd":197.30000019073486,"connectStart":197.30000019073486,"domainLookupEnd":197.30000019073486,"domainLookupStart":197.30000019073486,"fetchStart":197.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":229.70000004768372,"responseEnd":256.5,"responseStart":252.30000019073486,"secureConnectionStart":197.30000019073486},{"duration":328.90000009536743,"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":206.40000009536743,"connectEnd":206.40000009536743,"connectStart":206.40000009536743,"domainLookupEnd":206.40000009536743,"domainLookupStart":206.40000009536743,"fetchStart":206.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":259.10000014305115,"responseEnd":535.3000001907349,"responseStart":533.5,"secureConnectionStart":206.40000009536743},{"duration":334.5,"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":206.5,"connectEnd":206.5,"connectStart":206.5,"domainLookupEnd":206.5,"domainLookupStart":206.5,"fetchStart":206.5,"redirectEnd":0,"redirectStart":0,"requestStart":288.80000019073486,"responseEnd":541,"responseStart":536.5,"secureConnectionStart":206.5},{"duration":191,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":565,"connectEnd":565,"connectStart":565,"domainLookupEnd":565,"domainLookupStart":565,"fetchStart":565,"redirectEnd":0,"redirectStart":0,"requestStart":718.4000000953674,"responseEnd":756,"responseStart":753.2000000476837,"secureConnectionStart":565}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":13,"responseStart":186,"responseEnd":206,"domLoading":191,"domInteractive":968,"domContentLoadedEventStart":968,"domContentLoadedEventEnd":1017,"domComplete":1406,"loadEventStart":1406,"loadEventEnd":1407,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":949.5},{"name":"bigPipe.sidebar-id.end","time":950.1000001430511},{"name":"bigPipe.activity-panel-pipe-id.start","time":950.3000001907349},{"name":"bigPipe.activity-panel-pipe-id.end","time":951.3000001907349},{"name":"activityTabFullyLoaded","time":1069.6000001430511}],"measures":[],"correlationId":"c8fcfaafde178f","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":92,"dbReadsTimeInMs":10,"dbConnsTimeInMs":20,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
It looks it shouldn't call handlerton->create_group_by() if join_tab is null.
Please review the following commit.
5dc4d9b