CREATE TABLE t1 (i INT, c VARCHAR(8), KEY(c));
|
INSERT INTO t1 VALUES (1,'foo'),(9,'bar');
|
|
CREATE TABLE t2 (a INT);
|
INSERT INTO t2 VALUES (1),(2),(3),(4);
|
|
CREATE TABLE t3 (c VARCHAR(8));
|
INSERT INTO t3 VALUES ('abc'),('def');
|
|
CREATE OR REPLACE VIEW v AS
|
SELECT c AS val FROM t1 WHERE i IN ( SELECT i FROM t1 JOIN t2 ) GROUP BY val ;
|
|
SELECT * FROM t3 WHERE c IN ( SELECT val FROM v ) ;
|
10.3 016c35a7f2f4a288542f5fcb0e182c05238398e6
|
#3 <signal handler called>
|
#4 0x00005617ac8daae5 in update_ref_and_keys (thd=0x7f6bf8000b00, keyuse=0x7f6c09bcfb20, join_tab=0x7f6bf8046968, tables=3, cond=0x7f6bf8050718, normal_tables=18446744073709551615, select_lex=0x7f6bf80172e0, sargables=0x7f6c09bcfb18) at /data/src/10.3/sql/sql_select.cc:5683
|
#5 0x00005617ac90edb3 in JOIN::reoptimize (this=0x7f6bf803fa38, added_where=0x7f6bf8050718, join_tables=7, save_to=0x0) at /data/src/10.3/sql/sql_select.cc:25939
|
#6 0x00005617ac8e3324 in JOIN::push_splitting_cond_into_derived (this=0x7f6bf803fa38, thd=0x7f6bf8000b00, cond=0x7f6bf8050718) at /data/src/10.3/sql/sql_select.cc:9078
|
#7 0x00005617ac8e34b1 in JOIN::improve_chosen_plan (this=0x7f6bf803eca8, thd=0x7f6bf8000b00) at /data/src/10.3/sql/sql_select.cc:9105
|
#8 0x00005617ac8d7899 in make_join_statistics (join=0x7f6bf803eca8, tables_list=..., keyuse_array=0x7f6bf803ef98) at /data/src/10.3/sql/sql_select.cc:4516
|
#9 0x00005617ac8ccd3c in JOIN::optimize_inner (this=0x7f6bf803eca8) at /data/src/10.3/sql/sql_select.cc:1528
|
#10 0x00005617ac8cb6f4 in JOIN::optimize (this=0x7f6bf803eca8) at /data/src/10.3/sql/sql_select.cc:1123
|
#11 0x00005617ac8d479e in mysql_select (thd=0x7f6bf8000b00, tables=0x7f6bf8014c30, wild_num=1, fields=..., conds=0x7f6bf8016600, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f6bf801a938, unit=0x7f6bf80047c0, select_lex=0x7f6bf8004f00) at /data/src/10.3/sql/sql_select.cc:3723
|
#12 0x00005617ac8c8dbc in handle_select (thd=0x7f6bf8000b00, lex=0x7f6bf80046f8, result=0x7f6bf801a938, setup_tables_done_option=0) at /data/src/10.3/sql/sql_select.cc:378
|
#13 0x00005617ac89426e in execute_sqlcom_select (thd=0x7f6bf8000b00, all_tables=0x7f6bf8014c30) at /data/src/10.3/sql/sql_parse.cc:6466
|
#14 0x00005617ac88a7ef in mysql_execute_command (thd=0x7f6bf8000b00) at /data/src/10.3/sql/sql_parse.cc:3731
|
#15 0x00005617ac897bd4 in mysql_parse (thd=0x7f6bf8000b00, rawbuf=0x7f6bf8014a08 "SELECT * FROM t3 WHERE c IN ( SELECT val FROM v )", length=49, parser_state=0x7f6c09bd1610, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7921
|
#16 0x00005617ac88532e in dispatch_command (command=COM_QUERY, thd=0x7f6bf8000b00, packet=0x7f6bf800af11 "SELECT * FROM t3 WHERE c IN ( SELECT val FROM v ) ", packet_length=50, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1819
|
#17 0x00005617ac883d90 in do_command (thd=0x7f6bf8000b00) at /data/src/10.3/sql/sql_parse.cc:1370
|
#18 0x00005617ac9da646 in do_handle_one_connection (connect=0x5617afd31500) at /data/src/10.3/sql/sql_connect.cc:1418
|
#19 0x00005617ac9da3d3 in handle_one_connection (arg=0x5617afd31500) at /data/src/10.3/sql/sql_connect.cc:1324
|
#20 0x00005617ace521dc in pfs_spawn_thread (arg=0x5617afdd1f00) at /data/src/10.3/storage/perfschema/pfs.cc:1862
|
#21 0x00007f6c1187f494 in start_thread (arg=0x7f6c09bd2700) at pthread_create.c:333
|
#22 0x00007f6c0f9f793f in clone () from /lib/x86_64-linux-gnu/libc.so.6
|
Non-debug crashes in a similar way.
The problem appeared in bb-10.2-ext and later in 10.3 tree with this revision:
commit bf75dcac89d1496032015526dc6ce78d327e329f
|
Author: Igor Babaev <igor@askmonty.org>
|
Date: Thu Aug 10 14:25:19 2017 -0700
|
|
This is a modification of the first patch committed for mdev-13369
|
developed to cover the case of mdev-13389: "Optimization for equi-joins
|
of derived tables with window functions".
|
- relates to
-
MDEV-13710
Assertion `join->best_read < double(1.7...e+308L)' failed in greedy_search / choose_plan / JOIN::reoptimize
-
-
Closed
{"report":{"fcp":788.1000001430511,"ttfb":221.30000019073486,"pageVisibility":"visible","entityId":62957,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"2ffa3d9c-bff8-464c-af24-bcd557a9fd95","navigationType":0,"readyForUser":909.1000001430511,"redirectCount":0,"resourceLoadedEnd":507,"resourceLoadedStart":234.90000009536743,"resourceTiming":[{"duration":15.299999952316284,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":234.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":234.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":250.20000004768372,"responseStart":0,"secureConnectionStart":0},{"duration":18.199999809265137,"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":235.30000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":235.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":253.5,"responseStart":0,"secureConnectionStart":0},{"duration":159.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":235.40000009536743,"connectEnd":235.40000009536743,"connectStart":235.40000009536743,"domainLookupEnd":235.40000009536743,"domainLookupStart":235.40000009536743,"fetchStart":235.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":258.5,"responseEnd":394.90000009536743,"responseStart":278.5,"secureConnectionStart":235.40000009536743},{"duration":271.09999990463257,"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":235.90000009536743,"connectEnd":235.90000009536743,"connectStart":235.90000009536743,"domainLookupEnd":235.90000009536743,"domainLookupStart":235.90000009536743,"fetchStart":235.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":258.80000019073486,"responseEnd":507,"responseStart":282.5,"secureConnectionStart":235.90000009536743},{"duration":49.80000019073486,"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":236,"connectEnd":236,"connectStart":236,"domainLookupEnd":236,"domainLookupStart":236,"fetchStart":236,"redirectEnd":0,"redirectStart":0,"requestStart":259,"responseEnd":285.80000019073486,"responseStart":283.2000000476837,"secureConnectionStart":236},{"duration":54.10000014305115,"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":236.20000004768372,"connectEnd":236.20000004768372,"connectStart":236.20000004768372,"domainLookupEnd":236.20000004768372,"domainLookupStart":236.20000004768372,"fetchStart":236.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":260.80000019073486,"responseEnd":290.30000019073486,"responseStart":287,"secureConnectionStart":236.20000004768372},{"duration":54.40000009536743,"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":236.20000004768372,"connectEnd":236.20000004768372,"connectStart":236.20000004768372,"domainLookupEnd":236.20000004768372,"domainLookupStart":236.20000004768372,"fetchStart":236.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":262.7000000476837,"responseEnd":290.60000014305115,"responseStart":287.80000019073486,"secureConnectionStart":236.20000004768372},{"duration":20.299999952316284,"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":236.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":236.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":256.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":54.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":236.40000009536743,"connectEnd":236.40000009536743,"connectStart":236.40000009536743,"domainLookupEnd":236.40000009536743,"domainLookupStart":236.40000009536743,"fetchStart":236.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":262.90000009536743,"responseEnd":290.80000019073486,"responseStart":288.60000014305115,"secureConnectionStart":236.40000009536743},{"duration":24.100000143051147,"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":236.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":236.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":260.60000014305115,"responseStart":0,"secureConnectionStart":0},{"duration":55.799999952316284,"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":236.70000004768372,"connectEnd":236.70000004768372,"connectStart":236.70000004768372,"domainLookupEnd":236.70000004768372,"domainLookupStart":236.70000004768372,"fetchStart":236.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":263.60000014305115,"responseEnd":292.5,"responseStart":291.10000014305115,"secureConnectionStart":236.70000004768372},{"duration":198.39999985694885,"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":307.60000014305115,"connectEnd":307.60000014305115,"connectStart":307.60000014305115,"domainLookupEnd":307.60000014305115,"domainLookupStart":307.60000014305115,"fetchStart":307.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":320,"responseEnd":506,"responseStart":499,"secureConnectionStart":307.60000014305115},{"duration":198.90000009536743,"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":307.7000000476837,"connectEnd":307.7000000476837,"connectStart":307.7000000476837,"domainLookupEnd":307.7000000476837,"domainLookupStart":307.7000000476837,"fetchStart":307.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":328.30000019073486,"responseEnd":506.60000014305115,"responseStart":500.7000000476837,"secureConnectionStart":307.7000000476837},{"duration":75,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":544.3000001907349,"connectEnd":544.3000001907349,"connectStart":544.3000001907349,"domainLookupEnd":544.3000001907349,"domainLookupStart":544.3000001907349,"fetchStart":544.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":587.9000000953674,"responseEnd":619.3000001907349,"responseStart":618.6000001430511,"secureConnectionStart":544.3000001907349},{"duration":165.5,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":780.9000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":780.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":946.4000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":192.30000019073486,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":787.5,"connectEnd":787.5,"connectStart":787.5,"domainLookupEnd":787.5,"domainLookupStart":787.5,"fetchStart":787.5,"redirectEnd":0,"redirectStart":0,"requestStart":947.2000000476837,"responseEnd":979.8000001907349,"responseStart":978,"secureConnectionStart":787.5}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":59,"responseStart":221,"responseEnd":306,"domLoading":224,"domInteractive":967,"domContentLoadedEventStart":967,"domContentLoadedEventEnd":1007,"domComplete":1596,"loadEventStart":1596,"loadEventEnd":1597,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":950.4000000953674},{"name":"bigPipe.sidebar-id.end","time":951.2000000476837},{"name":"bigPipe.activity-panel-pipe-id.start","time":951.3000001907349},{"name":"bigPipe.activity-panel-pipe-id.end","time":952},{"name":"activityTabFullyLoaded","time":1025.1000001430511}],"measures":[],"correlationId":"6276e20bd1dc19","effectiveType":"4g","downlink":9.1,"rtt":0,"serverDuration":89,"dbReadsTimeInMs":19,"dbConnsTimeInMs":27,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
The patch fixing this bug was pushed into bb-10.2-ext.