Note: it is likely to be a duplicate of MDEV-12817, but the failure is different here, so I'm filing it separately just in case.
CREATE TABLE t1 (c1 INT);
|
INSERT INTO t1 VALUES (1),(2);
|
|
CREATE TABLE t2 (c2 INT);
|
INSERT INTO t2 VALUES (3),(4);
|
|
CREATE TABLE t3 (c3 INT);
|
INSERT INTO t2 VALUES (5),(6);
|
|
CREATE TABLE t4 (c4 INT);
|
INSERT INTO t4 VALUES (7),(8);
|
|
SELECT * FROM t1 LEFT JOIN ( ( SELECT * FROM t2 WHERE c2 IN ( SELECT c3 FROM t3 ) ) AS sq INNER JOIN t4 ) ON (c1 = c2);
|
5.5 2e1428c0b552f2c80aa4b27edaaab8bde8966b22
|
mysqld: /data/src/5.5/sql/sql_select.cc:6632: bool greedy_search(JOIN*, table_map, uint, uint): Assertion `join->best_read < double(1.79769313486231570815e+308L)' failed.
|
170517 0:59:20 [ERROR] mysqld got signal 6 ;
|
|
#7 0x00007f08ef9afee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
|
#8 0x0000000000640227 in greedy_search (join=0x7f08ea5720b8, remaining_tables=15, search_depth=62, prune_level=1) at /data/src/5.5/sql/sql_select.cc:6632
|
#9 0x000000000063f842 in choose_plan (join=0x7f08ea5720b8, join_tables=15) at /data/src/5.5/sql/sql_select.cc:6212
|
#10 0x000000000073b6f9 in optimize_semijoin_nests (join=0x7f08ea5720b8, all_table_map=15) at /data/src/5.5/sql/opt_subselect.cc:2244
|
#11 0x00000000006390c6 in make_join_statistics (join=0x7f08ea5720b8, tables_list=..., conds=0x0, keyuse_array=0x7f08ea5723d8) at /data/src/5.5/sql/sql_select.cc:3795
|
#12 0x00000000006300ce in JOIN::optimize (this=0x7f08ea5720b8) at /data/src/5.5/sql/sql_select.cc:1234
|
#13 0x0000000000636a65 in mysql_select (thd=0x7f08eb664060, rref_pointer_array=0x7f08eb667cf0, tables=0x7f08ea548328, wild_num=1, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f08ea572098, unit=0x7f08eb667388, select_lex=0x7f08eb667a68) at /data/src/5.5/sql/sql_select.cc:3085
|
#14 0x000000000062d352 in handle_select (thd=0x7f08eb664060, lex=0x7f08eb6672d8, result=0x7f08ea572098, setup_tables_done_option=0) at /data/src/5.5/sql/sql_select.cc:319
|
#15 0x00000000006067b3 in execute_sqlcom_select (thd=0x7f08eb664060, all_tables=0x7f08ea548328) at /data/src/5.5/sql/sql_parse.cc:4686
|
#16 0x00000000005ffb26 in mysql_execute_command (thd=0x7f08eb664060) at /data/src/5.5/sql/sql_parse.cc:2234
|
#17 0x000000000060937e in mysql_parse (thd=0x7f08eb664060, rawbuf=0x7f08ea548078 "SELECT * FROM t1 LEFT JOIN ( ( SELECT * FROM t2 WHERE c2 IN ( SELECT c3 FROM t3 ) ) AS sq INNER JOIN t4 ) ON (c1 = c2)", length=118, parser_state=0x7f08f1423650) at /data/src/5.5/sql/sql_parse.cc:5931
|
#18 0x00000000005fd0b5 in dispatch_command (command=COM_QUERY, thd=0x7f08eb664060, packet=0x7f08ef35b061 "SELECT * FROM t1 LEFT JOIN ( ( SELECT * FROM t2 WHERE c2 IN ( SELECT c3 FROM t3 ) ) AS sq INNER JOIN t4 ) ON (c1 = c2)", packet_length=118) at /data/src/5.5/sql/sql_parse.cc:1079
|
#19 0x00000000005fc26f in do_command (thd=0x7f08eb664060) at /data/src/5.5/sql/sql_parse.cc:793
|
#20 0x00000000006fe951 in do_handle_one_connection (thd_arg=0x7f08eb664060) at /data/src/5.5/sql/sql_connect.cc:1268
|
#21 0x00000000006fe6de in handle_one_connection (arg=0x7f08eb664060) at /data/src/5.5/sql/sql_connect.cc:1184
|
#22 0x0000000000a0bae7 in pfs_spawn_thread (arg=0x7f08ec376fc0) at /data/src/5.5/storage/perfschema/pfs.cc:1015
|
#23 0x00007f08f1056494 in start_thread (arg=0x7f08f1424700) at pthread_create.c:333
|
#24 0x00007f08efa6c93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
|
The problem appeared in 5.5 tree with this revision:
commit 6b97fe067db1b1d8e8dee56508e6d78a36e92481
|
Author: Igor Babaev
|
Date: Tue May 9 00:41:45 2017 -0700
|
|
Fixed the bugs mdev-12670 and mdev-12675.
|
|
The code that blocked conversion of a IN subselect pedicate to a semi-join
|
if it occurred in the ON expression of an outer join did not do it correctly.
|
As a result, the conversion was blocked for IN subselect predicates
|
encountered in ON expressions of INNER joins or in WHERE conditions
|
of mergeable views / derived tables. This patch fixes this problem.
|
{"report":{"fcp":1563.8999999999069,"ttfb":222.39999999990687,"pageVisibility":"visible","entityId":61392,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":16,"apdex":0.5,"journeyId":"c8b47257-1fe0-47cd-95b7-064313ec8df2","navigationType":0,"readyForUser":1712.7999999998137,"redirectCount":0,"resourceLoadedEnd":1110.8999999999069,"resourceLoadedStart":240.89999999990687,"resourceTiming":[{"duration":161.8000000002794,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":240.89999999990687,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":240.89999999990687,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":402.70000000018626,"responseStart":0,"secureConnectionStart":0},{"duration":162,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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":241.10000000009313,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":241.10000000009313,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":403.10000000009313,"responseStart":0,"secureConnectionStart":0},{"duration":635.1999999997206,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":241.10000000009313,"connectEnd":241.10000000009313,"connectStart":241.10000000009313,"domainLookupEnd":241.10000000009313,"domainLookupStart":241.10000000009313,"fetchStart":241.10000000009313,"redirectEnd":0,"redirectStart":0,"requestStart":405.29999999981374,"responseEnd":876.2999999998137,"responseStart":423.29999999981374,"secureConnectionStart":241.10000000009313},{"duration":839.0999999996275,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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":241.20000000018626,"connectEnd":241.20000000018626,"connectStart":241.20000000018626,"domainLookupEnd":241.20000000018626,"domainLookupStart":241.20000000018626,"fetchStart":241.20000000018626,"redirectEnd":0,"redirectStart":0,"requestStart":405.39999999990687,"responseEnd":1080.2999999998137,"responseStart":447.60000000009313,"secureConnectionStart":241.20000000018626},{"duration":184.89999999990687,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":241.39999999990687,"connectEnd":241.39999999990687,"connectStart":241.39999999990687,"domainLookupEnd":241.39999999990687,"domainLookupStart":241.39999999990687,"fetchStart":241.39999999990687,"redirectEnd":0,"redirectStart":0,"requestStart":405.5,"responseEnd":426.29999999981374,"responseStart":425.5,"secureConnectionStart":241.39999999990687},{"duration":240,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":241.39999999990687,"connectEnd":241.39999999990687,"connectStart":241.39999999990687,"domainLookupEnd":241.39999999990687,"domainLookupStart":241.39999999990687,"fetchStart":241.39999999990687,"redirectEnd":0,"redirectStart":0,"requestStart":410.10000000009313,"responseEnd":481.39999999990687,"responseStart":478.20000000018626,"secureConnectionStart":241.39999999990687},{"duration":253,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":241.5,"connectEnd":241.5,"connectStart":241.5,"domainLookupEnd":241.5,"domainLookupStart":241.5,"fetchStart":241.5,"redirectEnd":0,"redirectStart":0,"requestStart":414.20000000018626,"responseEnd":494.5,"responseStart":490.39999999990687,"secureConnectionStart":241.5},{"duration":164.79999999981374,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":241.60000000009313,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":241.60000000009313,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":406.39999999990687,"responseStart":0,"secureConnectionStart":0},{"duration":219.70000000018626,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":242,"connectEnd":242,"connectStart":242,"domainLookupEnd":242,"domainLookupStart":242,"fetchStart":242,"redirectEnd":0,"redirectStart":0,"requestStart":414.5,"responseEnd":461.70000000018626,"responseStart":458.39999999990687,"secureConnectionStart":242},{"duration":167.29999999981374,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/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":242.10000000009313,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":242.10000000009313,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":409.39999999990687,"responseStart":0,"secureConnectionStart":0},{"duration":224.79999999981374,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/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":242.20000000018626,"connectEnd":242.20000000018626,"connectStart":242.20000000018626,"domainLookupEnd":242.20000000018626,"domainLookupStart":242.20000000018626,"fetchStart":242.20000000018626,"redirectEnd":0,"redirectStart":0,"requestStart":414.70000000018626,"responseEnd":467,"responseStart":459.60000000009313,"secureConnectionStart":242.20000000018626},{"duration":866.4000000003725,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":242.79999999981374,"connectEnd":242.79999999981374,"connectStart":242.79999999981374,"domainLookupEnd":242.79999999981374,"domainLookupStart":242.79999999981374,"fetchStart":242.79999999981374,"redirectEnd":0,"redirectStart":0,"requestStart":488.39999999990687,"responseEnd":1109.2000000001863,"responseStart":1103,"secureConnectionStart":242.79999999981374},{"duration":868.1000000000931,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":242.79999999981374,"connectEnd":242.79999999981374,"connectStart":242.79999999981374,"domainLookupEnd":242.79999999981374,"domainLookupStart":242.79999999981374,"fetchStart":242.79999999981374,"redirectEnd":0,"redirectStart":0,"requestStart":515.6000000000931,"responseEnd":1110.8999999999069,"responseStart":1106.2000000001863,"secureConnectionStart":242.79999999981374},{"duration":161.39999999990687,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1045.5,"connectEnd":1045.5,"connectStart":1045.5,"domainLookupEnd":1045.5,"domainLookupStart":1045.5,"fetchStart":1045.5,"redirectEnd":0,"redirectStart":0,"requestStart":1173.8999999999069,"responseEnd":1206.8999999999069,"responseStart":1206.3999999999069,"secureConnectionStart":1045.5},{"duration":110.60000000009313,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1503.5,"connectEnd":1503.5,"connectStart":1503.5,"domainLookupEnd":1503.5,"domainLookupStart":1503.5,"fetchStart":1503.5,"redirectEnd":0,"redirectStart":0,"requestStart":1575.7999999998137,"responseEnd":1614.1000000000931,"responseStart":1611.2000000001863,"secureConnectionStart":1503.5},{"duration":24.200000000186265,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1555.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1555.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1579.7000000001863,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":54,"responseStart":222,"responseEnd":234,"domLoading":238,"domInteractive":1924,"domContentLoadedEventStart":1924,"domContentLoadedEventEnd":1990,"domComplete":2686,"loadEventStart":2686,"loadEventEnd":2688,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1852.6000000000931},{"name":"bigPipe.sidebar-id.end","time":1856.7999999998137},{"name":"bigPipe.activity-panel-pipe-id.start","time":1857},{"name":"bigPipe.activity-panel-pipe-id.end","time":1866.3999999999069},{"name":"activityTabFullyLoaded","time":1997.5}],"measures":[],"correlationId":"e8a3f42a098080","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":91,"dbReadsTimeInMs":11,"dbConnsTimeInMs":17,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}