Type:
Bug
Priority:
Major
Resolution:
Unresolved
Affects Version/s:
10.3.11 , 10.3.12 , 10.3.13 , 10.3(EOL) , 10.4(EOL) , 10.5
Environment:
CentOS 6.10 x64, Windows 10 x64
I had updated from MariaDB 10.1.38 to MariaDB 10.3.13 via WHM. In the process it updated to MariaDB 10.2.23 first. After the process ends, a single application has bugged. After dig a lot I discover what happen, but not why.
Run this code:
# SETUP
CREATE TABLE IF NOT EXISTS `test` (
`id` INT (10) UNSIGNED NOT NULL ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB;
# CRASHER CODE
SELECT test.id
FROM test
LEFT JOIN test AS join2
LEFT JOIN test AS join3
LEFT JOIN test AS join4
ON NULL AND
join4.id
ON FALSE
ON FALSE
LEFT JOIN test AS join1
ON FALSE ;
# CLEAN
DROP TABLE `test`;
The original query is very long, so I tried to simplificate this test case to the best that as I could.
If you run this code the server will crash with the following error:
SQL Error (2013): Lost connection to MySQL server during query
And the my.err will be (full log is attached ):
Thread pointer: 0x151f73f5d98
mysqld.exe!JOIN::fix_all_splittings_in_plan()[opt_split.cc:1152]
mysqld.exe!JOIN::optimize_inner()[sql_select.cc:1905]
mysqld.exe!JOIN::optimize()[sql_select.cc:1453]
mysqld.exe!mysql_select()[sql_select.cc:4225]
mysqld.exe!handle_select()[sql_select.cc:373]
mysqld.exe!execute_sqlcom_select()[sql_parse.cc:6551]
mysqld.exe!mysql_execute_command()[sql_parse.cc:3772]
I just run the server with: mysqld without any additional parameters.
I did it based on my original code that crashes, so please consider the following changes (I did it to simplificate, but crashes happen anyway):
The original code have five tables and is used at ON clauses to make sense. But set all ON to FALSE still will crashes;
The original code have only a single AS because the join1 and join2 tables are the same. All other tables are not aliases because are differents tables;
I did a lot of tests based on this simplified code that solves the crash, but will change the behaviour of query:
Dropping the PRIMARY_KEY from id will solve;
Dropping any JOIN or unwrapper it will solve;
Dropping NULL AND will solve;
Replacing NULL AND with NULL OR will solve;
Replacing join4.id to join3.id will solve;
Replacing NULL with any other value will solve;
Moving join1 over join2 will solve;
Moving join1 to inside of join2 , join3 or join4 will solve;
Moving join2 , join3 or join4 to inside of join1 will solve;
Using other engines than not InnoDB or MRG_MyISAM will solve;
Adding parentheses to JOIN will not solve;
Adding PRIMARY_KEY to id will not solve;
Swapping join4.id with NULL will not solve;
Replacing NULL with NOT NULL will not solve;
I test some previous versions, and the problems starts in MariaDB 10.3.11 and still affects MariaDB 10.3.12 and MariaDB 10.3.13 (current).
Actually, the problem seems to be related with the `NULL AND`. For some reason it crashes the server.
{"report":{"fcp":928.3000001907349,"ttfb":278.19999980926514,"pageVisibility":"visible","entityId":74152,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"40c35e7c-1662-4252-b8c2-257464b6078a","navigationType":0,"readyForUser":1032.8999996185303,"redirectCount":0,"resourceLoadedEnd":1500.5999994277954,"resourceLoadedStart":284.69999980926514,"resourceTiming":[{"duration":82.39999961853027,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":284.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":284.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":367.0999994277954,"responseStart":0,"secureConnectionStart":0},{"duration":82.59999942779541,"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":285,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":285,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":367.5999994277954,"responseStart":0,"secureConnectionStart":0},{"duration":141.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":285.19999980926514,"connectEnd":285.19999980926514,"connectStart":285.19999980926514,"domainLookupEnd":285.19999980926514,"domainLookupStart":285.19999980926514,"fetchStart":285.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":285.19999980926514,"responseEnd":426.69999980926514,"responseStart":426.69999980926514,"secureConnectionStart":285.19999980926514},{"duration":221.5,"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":285.30000019073486,"connectEnd":285.30000019073486,"connectStart":285.30000019073486,"domainLookupEnd":285.30000019073486,"domainLookupStart":285.30000019073486,"fetchStart":285.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":285.30000019073486,"responseEnd":506.80000019073486,"responseStart":506.80000019073486,"secureConnectionStart":285.30000019073486},{"duration":225.30000019073486,"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":285.5999994277954,"connectEnd":285.5999994277954,"connectStart":285.5999994277954,"domainLookupEnd":285.5999994277954,"domainLookupStart":285.5999994277954,"fetchStart":285.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":285.5999994277954,"responseEnd":510.8999996185303,"responseStart":510.8999996185303,"secureConnectionStart":285.5999994277954},{"duration":225.5999994277954,"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":285.80000019073486,"connectEnd":285.80000019073486,"connectStart":285.80000019073486,"domainLookupEnd":285.80000019073486,"domainLookupStart":285.80000019073486,"fetchStart":285.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":285.80000019073486,"responseEnd":511.3999996185303,"responseStart":511.3999996185303,"secureConnectionStart":285.80000019073486},{"duration":225.80000019073486,"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":286,"connectEnd":286,"connectStart":286,"domainLookupEnd":286,"domainLookupStart":286,"fetchStart":286,"redirectEnd":0,"redirectStart":0,"requestStart":286,"responseEnd":511.80000019073486,"responseStart":511.80000019073486,"secureConnectionStart":286},{"duration":293.80000019073486,"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":286.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":286.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":580,"responseStart":0,"secureConnectionStart":0},{"duration":225.89999961853027,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":286.30000019073486,"connectEnd":286.30000019073486,"connectStart":286.30000019073486,"domainLookupEnd":286.30000019073486,"domainLookupStart":286.30000019073486,"fetchStart":286.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":286.30000019073486,"responseEnd":512.1999998092651,"responseStart":512.1999998092651,"secureConnectionStart":286.30000019073486},{"duration":293.80000019073486,"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":286.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":286.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":580.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":226.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":286.69999980926514,"connectEnd":286.69999980926514,"connectStart":286.69999980926514,"domainLookupEnd":286.69999980926514,"domainLookupStart":286.69999980926514,"fetchStart":286.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":286.69999980926514,"responseEnd":512.8999996185303,"responseStart":512.8999996185303,"secureConnectionStart":286.69999980926514},{"duration":1206.1000003814697,"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":287.69999980926514,"connectEnd":287.69999980926514,"connectStart":287.69999980926514,"domainLookupEnd":287.69999980926514,"domainLookupStart":287.69999980926514,"fetchStart":287.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":287.69999980926514,"responseEnd":1493.8000001907349,"responseStart":1493.8000001907349,"secureConnectionStart":287.69999980926514},{"duration":1206.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":287.80000019073486,"connectEnd":287.80000019073486,"connectStart":287.80000019073486,"domainLookupEnd":287.80000019073486,"domainLookupStart":287.80000019073486,"fetchStart":287.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":287.80000019073486,"responseEnd":1494.3000001907349,"responseStart":1494.3000001907349,"secureConnectionStart":287.80000019073486},{"duration":148.69999980926514,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":592.3999996185303,"connectEnd":592.3999996185303,"connectStart":592.3999996185303,"domainLookupEnd":592.3999996185303,"domainLookupStart":592.3999996185303,"fetchStart":592.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":592.3999996185303,"responseEnd":741.0999994277954,"responseStart":741.0999994277954,"secureConnectionStart":592.3999996185303},{"duration":619.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/50bc9be5bfead1a25e72c1a9338c94f6-CDN/lu2cib/820016/12ta74/e108c7645258ccb43280ed3404e3e949/_/download/contextbatch/css/com.atlassian.jira.plugins.jira-development-integration-plugin:0,-_super,-jira.view.issue,-jira.global,-jira.general,-jira.browse.project,-project.issue.navigator,-atl.general/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":878.0999994277954,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":878.0999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1497.5999994277954,"responseStart":0,"secureConnectionStart":0},{"duration":619.2000007629395,"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":878.5999994277954,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":878.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1497.8000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":615.7000007629395,"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":879.5999994277954,"connectEnd":879.5999994277954,"connectStart":879.5999994277954,"domainLookupEnd":879.5999994277954,"domainLookupStart":879.5999994277954,"fetchStart":879.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":879.5999994277954,"responseEnd":1495.3000001907349,"responseStart":1495.3000001907349,"secureConnectionStart":879.5999994277954},{"duration":616.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/e0bf5781d46ea69fb123572974cf39de-CDN/lu2cib/820016/12ta74/e108c7645258ccb43280ed3404e3e949/_/download/contextbatch/js/com.atlassian.jira.plugins.jira-development-integration-plugin:0,-_super,-jira.view.issue,-jira.global,-jira.general,-jira.browse.project,-project.issue.navigator,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":880,"connectEnd":880,"connectStart":880,"domainLookupEnd":880,"domainLookupStart":880,"fetchStart":880,"redirectEnd":0,"redirectStart":0,"requestStart":880,"responseEnd":1496.5,"responseStart":1496.5,"secureConnectionStart":880},{"duration":620.1999998092651,"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":880.3999996185303,"connectEnd":880.3999996185303,"connectStart":880.3999996185303,"domainLookupEnd":880.3999996185303,"domainLookupStart":880.3999996185303,"fetchStart":880.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":880.3999996185303,"responseEnd":1500.5999994277954,"responseStart":1500.5999994277954,"secureConnectionStart":880.3999996185303},{"duration":672.8999996185303,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":922.1999998092651,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":922.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1595.0999994277954,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":103,"responseStart":278,"responseEnd":280,"domLoading":282,"domInteractive":1539,"domContentLoadedEventStart":1539,"domContentLoadedEventEnd":1588,"domComplete":3224,"loadEventStart":3224,"loadEventEnd":3226,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1509.3000001907349},{"name":"bigPipe.sidebar-id.end","time":1510.0999994277954},{"name":"bigPipe.activity-panel-pipe-id.start","time":1510.3000001907349},{"name":"bigPipe.activity-panel-pipe-id.end","time":1512.6999998092651},{"name":"activityTabFullyLoaded","time":1599.8999996185303}],"measures":[],"correlationId":"22274d38f1729a","effectiveType":"4g","downlink":9.1,"rtt":0,"serverDuration":110,"dbReadsTimeInMs":17,"dbConnsTimeInMs":26,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}