Type:
Bug
Priority:
Blocker
Resolution:
Fixed
Affects Version/s:
5.5.56 , 10.1.23 , 5.5(EOL) , 10.0(EOL) , 10.1(EOL) , 10.2(EOL)
CREATE TABLE t1 (i1 INT ) ENGINE=MyISAM;
# To reproduce, the table should have 0 or 1 rows
INSERT INTO t1 VALUES (1);
CREATE TABLE t2 (i2 INT , c2 VARCHAR (3), KEY (i2,c2)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1, 'abc' ),(2, 'xyz' );
CREATE TABLE t3 (pk3 INT PRIMARY KEY , c3 VARCHAR (3)) ENGINE=MyISAM;
INSERT INTO t3 VALUES (1, 'foo' ),(2, 'bar' );
SELECT * FROM t1 WHERE i1 NOT IN (
SELECT i2 FROM t2 RIGHT JOIN t3 ON (c3 = c2) WHERE pk3 = i1
);
5.5 14fca28ea44dabf62e75e2aa9a90d71bd7be45c0
#3 <signal handler called>
#4 0x0000000000646f00 in create_ref_for_key (join=0x7faae1db5078, j=0x7faae1db9710, org_keyuse=0x7faae1c914b0, allow_full_scan=true, used_tables=4611686018427387906) at /data/src/5.5/sql/sql_select.cc:8066
#5 0x00000000006466b6 in get_best_combination (join=0x7faae1db5078) at /data/src/5.5/sql/sql_select.cc:7850
#6 0x000000000063cc2d in make_join_statistics (join=0x7faae1db5078, tables_list=..., conds=0x0, keyuse_array=0x7faae1db5398) at /data/src/5.5/sql/sql_select.cc:3837
#7 0x0000000000633910 in JOIN::optimize (this=0x7faae1db5078) at /data/src/5.5/sql/sql_select.cc:1234
#8 0x00000000005f92a1 in st_select_lex::optimize_unflattened_subqueries (this=0x7faae2e77a68, const_only=false) at /data/src/5.5/sql/sql_lex.cc:3549
#9 0x000000000074535a in JOIN::optimize_unflattened_subqueries (this=0x7faae1d81328) at /data/src/5.5/sql/opt_subselect.cc:4984
#10 0x00000000006353b5 in JOIN::optimize (this=0x7faae1d81328) at /data/src/5.5/sql/sql_select.cc:1670
#11 0x000000000063a2a7 in mysql_select (thd=0x7faae2e74060, rref_pointer_array=0x7faae2e77cd8, tables=0x7faae1d48308, wild_num=1, fields=..., conds=0x7faae1d81190, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7faae1d81308, unit=0x7faae2e77388, select_lex=0x7faae2e77a68) at /data/src/5.5/sql/sql_select.cc:3085
#12 0x0000000000630b94 in handle_select (thd=0x7faae2e74060, lex=0x7faae2e772d8, result=0x7faae1d81308, setup_tables_done_option=0) at /data/src/5.5/sql/sql_select.cc:319
#13 0x000000000060a08b in execute_sqlcom_select (thd=0x7faae2e74060, all_tables=0x7faae1d48308) at /data/src/5.5/sql/sql_parse.cc:4686
#14 0x00000000006033fe in mysql_execute_command (thd=0x7faae2e74060) at /data/src/5.5/sql/sql_parse.cc:2234
#15 0x000000000060cc56 in mysql_parse (thd=0x7faae2e74060, rawbuf=0x7faae1d48078 "SELECT * FROM t1 WHERE i1 NOT IN ( \nSELECT i2 FROM t2 RIGHT JOIN t3 ON (c3 = c2) WHERE pk3 = i1 \n)", length=98, parser_state=0x7faae93b1650) at /data/src/5.5/sql/sql_parse.cc:5931
#16 0x000000000060098d in dispatch_command (command=COM_QUERY, thd=0x7faae2e74060, packet=0x7faae3b4e061 "SELECT * FROM t1 WHERE i1 NOT IN ( \nSELECT i2 FROM t2 RIGHT JOIN t3 ON (c3 = c2) WHERE pk3 = i1 \n)", packet_length=98) at /data/src/5.5/sql/sql_parse.cc:1079
#17 0x00000000005ffb47 in do_command (thd=0x7faae2e74060) at /data/src/5.5/sql/sql_parse.cc:793
#18 0x000000000070213b in do_handle_one_connection (thd_arg=0x7faae2e74060) at /data/src/5.5/sql/sql_connect.cc:1268
#19 0x0000000000701ec8 in handle_one_connection (arg=0x7faae2e74060) at /data/src/5.5/sql/sql_connect.cc:1184
#20 0x0000000000944c7d in pfs_spawn_thread (arg=0x7faae3b7a3a0) at /data/src/5.5/storage/perfschema/pfs.cc:1015
#21 0x00007faae8fee064 in start_thread (arg=0x7faae93b2700) at pthread_create.c:309
#22 0x00007faae741462d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
The problem appeared in 5.5 tree with this commit:
commit 2e7ba70a94b5950a7d1d733c177d1b2a24916213
Author: Igor Babaev
Date: Sat Apr 22 10:30:55 2017 -0700
Fixed the bug mdev-10693.
Another test case, crashes both with MyISAM and InnoDB (and with Aria too):
CREATE TABLE t1 (pk1 INT , a1 VARCHAR (3), b1 VARCHAR (3), PRIMARY KEY (pk1), KEY (a1), KEY (b1));
INSERT INTO t1 VALUES (1, 'foo' , 'bar' ),(2, 'bar' , 'foo' );
CREATE TABLE t2 (pk2 INT PRIMARY KEY , a2 VARCHAR (3), KEY (a2));
INSERT INTO t2 VALUES (1, 'abc' ),(2, 'xyz' );
SELECT 'qux' IN ( SELECT a1 FROM t1 INNER JOIN t2 WHERE a2 = b1 AND pk2 = 1 );
duplicates
MDEV-12726
Segmentation fault in MariaDB 10.1.23 while query executing.
Closed
Transition
Time In Source Status
Execution Times
Open
Closed
1d 12h 2m
1
{"report":{"fcp":1121.2000000476837,"ttfb":556.2000000476837,"pageVisibility":"visible","entityId":61175,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"4bfc3f04-650d-4628-9942-dac212c67f07","navigationType":0,"readyForUser":1244.9000000953674,"redirectCount":0,"resourceLoadedEnd":846.9000000953674,"resourceLoadedStart":580.4000000953674,"resourceTiming":[{"duration":13.899999856948853,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bsh/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":580.4000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":580.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":594.2999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":15.600000143051147,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bsh/820016/12ta74/eb142f92e4bd16bd1ef8b08c1b9d5d56/_/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":580.7999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":580.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":596.4000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":155.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/b09d0d077992e4331b5f9ec0d3ec448c-CDN/lu2bsh/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":580.7999999523163,"connectEnd":580.7999999523163,"connectStart":580.7999999523163,"domainLookupEnd":580.7999999523163,"domainLookupStart":580.7999999523163,"fetchStart":580.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":598,"responseEnd":736.5,"responseStart":612.6000001430511,"secureConnectionStart":580.7999999523163},{"duration":265.10000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/b47ab3df14096803b180217eb8482517-CDN/lu2bsh/820016/12ta74/eb142f92e4bd16bd1ef8b08c1b9d5d56/_/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":581.7999999523163,"connectEnd":581.7999999523163,"connectStart":581.7999999523163,"domainLookupEnd":581.7999999523163,"domainLookupStart":581.7999999523163,"fetchStart":581.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":599.7000000476837,"responseEnd":846.9000000953674,"responseStart":615.7999999523163,"secureConnectionStart":581.7999999523163},{"duration":36.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/6c569cbf8087ab04e40d0bef98627457-CDN/lu2bsh/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":581.9000000953674,"connectEnd":581.9000000953674,"connectStart":581.9000000953674,"domainLookupEnd":581.9000000953674,"domainLookupStart":581.9000000953674,"fetchStart":581.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":600.5,"responseEnd":618.5,"responseStart":617.4000000953674,"secureConnectionStart":581.9000000953674},{"duration":40.799999952316284,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":582,"connectEnd":582,"connectStart":582,"domainLookupEnd":582,"domainLookupStart":582,"fetchStart":582,"redirectEnd":0,"redirectStart":0,"requestStart":601.2999999523163,"responseEnd":622.7999999523163,"responseStart":620.7999999523163,"secureConnectionStart":582},{"duration":40.89999985694885,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":582.1000001430511,"connectEnd":582.1000001430511,"connectStart":582.1000001430511,"domainLookupEnd":582.1000001430511,"domainLookupStart":582.1000001430511,"fetchStart":582.1000001430511,"redirectEnd":0,"redirectStart":0,"requestStart":602.2000000476837,"responseEnd":623,"responseStart":621.4000000953674,"secureConnectionStart":582.1000001430511},{"duration":18.799999952316284,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bsh/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":582.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":582.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":601,"responseStart":0,"secureConnectionStart":0},{"duration":43.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":582.2999999523163,"connectEnd":582.2999999523163,"connectStart":582.2999999523163,"domainLookupEnd":582.2999999523163,"domainLookupStart":582.2999999523163,"fetchStart":582.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":603.5,"responseEnd":625.7000000476837,"responseStart":624.1000001430511,"secureConnectionStart":582.2999999523163},{"duration":20,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bsh/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":582.4000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":582.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":602.4000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":58.700000047683716,"initiatorType":"script","name":"https://jira.mariadb.org/s/81b5d7c27af3ebc078cc4a36383678ba-CDN/lu2bsh/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":582.5,"connectEnd":582.5,"connectStart":582.5,"domainLookupEnd":582.5,"domainLookupStart":582.5,"fetchStart":582.5,"redirectEnd":0,"redirectStart":0,"requestStart":605.2000000476837,"responseEnd":641.2000000476837,"responseStart":638.2000000476837,"secureConnectionStart":582.5},{"duration":21.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":594.9000000953674,"connectEnd":594.9000000953674,"connectStart":594.9000000953674,"domainLookupEnd":594.9000000953674,"domainLookupStart":594.9000000953674,"fetchStart":594.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":594.9000000953674,"responseEnd":616.5,"responseStart":616.5,"secureConnectionStart":594.9000000953674},{"duration":29.299999952316284,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":595,"connectEnd":595,"connectStart":595,"domainLookupEnd":595,"domainLookupStart":595,"fetchStart":595,"redirectEnd":0,"redirectStart":0,"requestStart":595,"responseEnd":624.2999999523163,"responseStart":624.2999999523163,"secureConnectionStart":595},{"duration":86.70000004768372,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":882.5,"connectEnd":882.5,"connectStart":882.5,"domainLookupEnd":882.5,"domainLookupStart":882.5,"fetchStart":882.5,"redirectEnd":0,"redirectStart":0,"requestStart":937.6000001430511,"responseEnd":969.2000000476837,"responseStart":968.4000000953674,"secureConnectionStart":882.5},{"duration":93.19999980926514,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1114.1000001430511,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1114.1000001430511,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1207.2999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":118,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1121.1000001430511,"connectEnd":1121.1000001430511,"connectStart":1121.1000001430511,"domainLookupEnd":1121.1000001430511,"domainLookupStart":1121.1000001430511,"fetchStart":1121.1000001430511,"redirectEnd":0,"redirectStart":0,"requestStart":1208,"responseEnd":1239.1000001430511,"responseStart":1238.2999999523163,"secureConnectionStart":1121.1000001430511}],"fetchStart":1,"domainLookupStart":1,"domainLookupEnd":1,"connectStart":1,"connectEnd":1,"requestStart":37,"responseStart":557,"responseEnd":594,"domLoading":560,"domInteractive":1311,"domContentLoadedEventStart":1311,"domContentLoadedEventEnd":1357,"domComplete":1659,"loadEventStart":1659,"loadEventEnd":1659,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1292.4000000953674},{"name":"bigPipe.sidebar-id.end","time":1293.1000001430511},{"name":"bigPipe.activity-panel-pipe-id.start","time":1293.2999999523163},{"name":"bigPipe.activity-panel-pipe-id.end","time":1294.1000001430511},{"name":"activityTabFullyLoaded","time":1372.6000001430511}],"measures":[],"correlationId":"5bb364951342bd","effectiveType":"4g","downlink":9.8,"rtt":0,"serverDuration":430,"dbReadsTimeInMs":16,"dbConnsTimeInMs":54,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}