MariaDB 10.0.21 crashes during preparation of an UPDATE statement with a SELECT subquery in combination with ONLY_FULL_GROUP_BY.
One can reproduce the issue using docker as follows:
First start the MariaDB database container:
docker run -it --rm --name crasher -e MYSQL_ROOT_PASSWORD=root mariadb:10.0.21
|
Afterwards connect with the MariaDB command line client:
docker run -ti --rm --link crasher:mariadb mariadb mysql --host=mariadb -proot
|
Inside the command line client perform the following querys:
-- create test database
|
CREATE DATABASE IF NOT EXISTS db; use db;
|
-- drop test tables
|
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t2;
|
-- create test tables
|
CREATE TABLE t1 ( id INT(10), value INT(10) ); CREATE TABLE t2 ( id INT(10) );
|
-- enable full group by
|
SET SESSION sql_mode = 'ONLY_FULL_GROUP_BY';
|
-- try to prepare query
|
PREPARE stmt FROM 'UPDATE t1 t1 SET value = (SELECT 1 FROM t2 WHERE id = t1.id)';
|
The last query will return:
ERROR 2013 (HY000): Lost connection to MySQL server during query
|
And the server crashes because of signal 11. The stack trace is a follows:
Thread pointer: 0x0x7fa1d3641008
|
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 = 0x7fa1f779ce70 thread_stack 0x48000
|
mysqld(my_print_stacktrace+0x3d)[0x7fa1f7195a2d]
|
mysqld(handle_fatal_signal+0x31a)[0x7fa1f6cd375a]
|
/lib/x86_64-linux-gnu/libpthread.so.0(+0xf8d0)[0x7fa1f633d8d0]
|
mysqld(_ZN10Item_field15fix_outer_fieldEP3THDPP5FieldPP4Item+0x14c)[0x7fa1f6cf8a1c]
|
mysqld(_ZN10Item_field10fix_fieldsEP3THDPP4Item+0x4f2)[0x7fa1f6cf9742]
|
mysqld(_ZN9Item_func10fix_fieldsEP3THDPP4Item+0x1b3)[0x7fa1f6d2f3a3]
|
mysqld(_Z11setup_condsP3THDP10TABLE_LISTR4ListIS1_EPP4Item+0x1c3)[0x7fa1f6b09573]
|
mysqld(+0x42f111)[0x7fa1f6b9d111]
|
mysqld(_ZN30subselect_single_select_engine7prepareEv+0x688)[0x7fa1f6d62788]
|
mysqld(_ZN14Item_subselect10fix_fieldsEP3THDPP4Item+0xed)[0x7fa1f6d60aed]
|
mysqld(_Z12setup_fieldsP3THDPP4ItemR4ListIS1_E17enum_mark_columnsPS5_b+0x184)[0x7fa1f6b07594]
|
mysqld(+0x3f7f7a)[0x7fa1f6b65f7a]
|
mysqld(_ZN18Prepared_statement7prepareEPKcj+0x6dd)[0x7fa1f6b6771d]
|
mysqld(_Z22mysql_sql_stmt_prepareP3THD+0x39f)[0x7fa1f6b67caf]
|
mysqld(_Z21mysql_execute_commandP3THD+0x90e)[0x7fa1f6b4edfe]
|
mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x1e2)[0x7fa1f6b551d2]
|
mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x1787)[0x7fa1f6b56f87]
|
mysqld(_Z24do_handle_one_connectionP3THD+0x28b)[0x7fa1f6c2da5b]
|
mysqld(handle_one_connection+0x40)[0x7fa1f6c2dac0]
|
/lib/x86_64-linux-gnu/libpthread.so.0(+0x80a4)[0x7fa1f63360a4]
|
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7fa1f493e04d]
|
|
Trying to get some variables.
|
Some pointers may be invalid and cause the dump to abort.
|
Query (0x7fa1be042408): is an invalid pointer
|
Connection ID (thread ID): 2
|
Status: NOT_KILLED
|
{"report":{"fcp":1632.3999996185303,"ttfb":326,"pageVisibility":"visible","entityId":52966,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"cf55ce8c-8e81-46e1-9c19-f4c263643693","navigationType":0,"readyForUser":1734.5999999046326,"redirectCount":0,"resourceLoadedEnd":1214.1999998092651,"resourceLoadedStart":346.3999996185303,"resourceTiming":[{"duration":53.10000038146973,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":346.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":346.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":399.5,"responseStart":0,"secureConnectionStart":0},{"duration":53.09999990463257,"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":346.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":346.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":399.7999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":656.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":346.8999996185303,"connectEnd":346.8999996185303,"connectStart":346.8999996185303,"domainLookupEnd":346.8999996185303,"domainLookupStart":346.8999996185303,"fetchStart":346.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":402.3999996185303,"responseEnd":1003.3999996185303,"responseStart":499.3999996185303,"secureConnectionStart":346.8999996185303},{"duration":867.0999999046326,"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":347.09999990463257,"connectEnd":347.09999990463257,"connectStart":347.09999990463257,"domainLookupEnd":347.09999990463257,"domainLookupStart":347.09999990463257,"fetchStart":347.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":408.69999980926514,"responseEnd":1214.1999998092651,"responseStart":502.09999990463257,"secureConnectionStart":347.09999990463257},{"duration":169.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":347.2999997138977,"connectEnd":347.2999997138977,"connectStart":347.2999997138977,"domainLookupEnd":347.2999997138977,"domainLookupStart":347.2999997138977,"fetchStart":347.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":411.5,"responseEnd":516.5999999046326,"responseStart":507.7999997138977,"secureConnectionStart":347.2999997138977},{"duration":169.39999961853027,"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":347.5,"connectEnd":347.5,"connectStart":347.5,"domainLookupEnd":347.5,"domainLookupStart":347.5,"fetchStart":347.5,"redirectEnd":0,"redirectStart":0,"requestStart":413.69999980926514,"responseEnd":516.8999996185303,"responseStart":513.7999997138977,"secureConnectionStart":347.5},{"duration":169.30000019073486,"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":347.69999980926514,"connectEnd":347.69999980926514,"connectStart":347.69999980926514,"domainLookupEnd":347.69999980926514,"domainLookupStart":347.69999980926514,"fetchStart":347.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":416.19999980926514,"responseEnd":517,"responseStart":514.2999997138977,"secureConnectionStart":347.69999980926514},{"duration":64.40000009536743,"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":347.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":347.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":412.2999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":178.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":348,"connectEnd":348,"connectStart":348,"domainLookupEnd":348,"domainLookupStart":348,"fetchStart":348,"redirectEnd":0,"redirectStart":0,"requestStart":420.59999990463257,"responseEnd":526.0999999046326,"responseStart":517.0999999046326,"secureConnectionStart":348},{"duration":63.700000286102295,"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":348.7999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":348.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":412.5,"responseStart":0,"secureConnectionStart":0},{"duration":183.39999961853027,"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":349,"connectEnd":349,"connectStart":349,"domainLookupEnd":349,"domainLookupStart":349,"fetchStart":349,"redirectEnd":0,"redirectStart":0,"requestStart":430.69999980926514,"responseEnd":532.3999996185303,"responseStart":528.7999997138977,"secureConnectionStart":349},{"duration":847.4000000953674,"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":359.2999997138977,"connectEnd":359.2999997138977,"connectStart":359.2999997138977,"domainLookupEnd":359.2999997138977,"domainLookupStart":359.2999997138977,"fetchStart":359.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":507.19999980926514,"responseEnd":1206.6999998092651,"responseStart":1198.8999996185303,"secureConnectionStart":359.2999997138977},{"duration":848.7000002861023,"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":359.3999996185303,"connectEnd":359.3999996185303,"connectStart":359.3999996185303,"domainLookupEnd":359.3999996185303,"domainLookupStart":359.3999996185303,"fetchStart":359.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":564.7999997138977,"responseEnd":1208.0999999046326,"responseStart":1202.0999999046326,"secureConnectionStart":359.3999996185303},{"duration":260.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1191.1999998092651,"connectEnd":1191.1999998092651,"connectStart":1191.1999998092651,"domainLookupEnd":1191.1999998092651,"domainLookupStart":1191.1999998092651,"fetchStart":1191.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":1378,"responseEnd":1451.6999998092651,"responseStart":1425.8999996185303,"secureConnectionStart":1191.1999998092651},{"duration":313.19999980926514,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1542,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1542,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1855.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":283.80000019073486,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1580.2999997138977,"connectEnd":1580.2999997138977,"connectStart":1580.2999997138977,"domainLookupEnd":1580.2999997138977,"domainLookupStart":1580.2999997138977,"fetchStart":1580.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":1827.5999999046326,"responseEnd":1864.0999999046326,"responseStart":1863.3999996185303,"secureConnectionStart":1580.2999997138977}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":7,"responseStart":326,"responseEnd":359,"domLoading":340,"domInteractive":1857,"domContentLoadedEventStart":1857,"domContentLoadedEventEnd":1908,"domComplete":2289,"loadEventStart":2289,"loadEventEnd":2290,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1837.8999996185303},{"name":"bigPipe.sidebar-id.end","time":1838.6999998092651},{"name":"bigPipe.activity-panel-pipe-id.start","time":1838.8999996185303},{"name":"bigPipe.activity-panel-pipe-id.end","time":1840.5},{"name":"activityTabFullyLoaded","time":1934.1999998092651}],"measures":[],"correlationId":"1bd67b9dd4e0a2","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":143,"dbReadsTimeInMs":11,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
This issue still exists in 10.1.