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":1046.2000000476837,"ttfb":301.2999999523163,"pageVisibility":"visible","entityId":62957,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"95e43944-ea45-4840-9dd6-4ca3d8a7a255","navigationType":0,"readyForUser":1134.8999998569489,"redirectCount":0,"resourceLoadedEnd":1207.0999999046326,"resourceLoadedStart":306.2000000476837,"resourceTiming":[{"duration":270,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":306.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":306.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":576.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":270.2000000476837,"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":306.39999985694885,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":306.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":576.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":284.60000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":306.59999990463257,"connectEnd":306.59999990463257,"connectStart":306.59999990463257,"domainLookupEnd":306.59999990463257,"domainLookupStart":306.59999990463257,"fetchStart":306.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":306.59999990463257,"responseEnd":591.2000000476837,"responseStart":591.2000000476837,"secureConnectionStart":306.59999990463257},{"duration":352.40000009536743,"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":306.7999999523163,"connectEnd":306.7999999523163,"connectStart":306.7999999523163,"domainLookupEnd":306.7999999523163,"domainLookupStart":306.7999999523163,"fetchStart":306.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":306.7999999523163,"responseEnd":659.2000000476837,"responseStart":659.2000000476837,"secureConnectionStart":306.7999999523163},{"duration":355.39999985694885,"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":307,"connectEnd":307,"connectStart":307,"domainLookupEnd":307,"domainLookupStart":307,"fetchStart":307,"redirectEnd":0,"redirectStart":0,"requestStart":307,"responseEnd":662.3999998569489,"responseStart":662.3999998569489,"secureConnectionStart":307},{"duration":355.7999999523163,"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":307.09999990463257,"connectEnd":307.09999990463257,"connectStart":307.09999990463257,"domainLookupEnd":307.09999990463257,"domainLookupStart":307.09999990463257,"fetchStart":307.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":307.09999990463257,"responseEnd":662.8999998569489,"responseStart":662.8999998569489,"secureConnectionStart":307.09999990463257},{"duration":355.90000009536743,"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":307.2999999523163,"connectEnd":307.2999999523163,"connectStart":307.2999999523163,"domainLookupEnd":307.2999999523163,"domainLookupStart":307.2999999523163,"fetchStart":307.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":307.2999999523163,"responseEnd":663.2000000476837,"responseStart":663.2000000476837,"secureConnectionStart":307.2999999523163},{"duration":424.09999990463257,"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":307.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":307.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":731.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":356,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":307.59999990463257,"connectEnd":307.59999990463257,"connectStart":307.59999990463257,"domainLookupEnd":307.59999990463257,"domainLookupStart":307.59999990463257,"fetchStart":307.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":307.59999990463257,"responseEnd":663.5999999046326,"responseStart":663.5999999046326,"secureConnectionStart":307.59999990463257},{"duration":423.90000009536743,"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":307.89999985694885,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":307.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":731.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":356.2999999523163,"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":308,"connectEnd":308,"connectStart":308,"domainLookupEnd":308,"domainLookupStart":308,"fetchStart":308,"redirectEnd":0,"redirectStart":0,"requestStart":308,"responseEnd":664.2999999523163,"responseStart":664.2000000476837,"secureConnectionStart":308},{"duration":540.7000000476837,"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":326.09999990463257,"connectEnd":326.09999990463257,"connectStart":326.09999990463257,"domainLookupEnd":326.09999990463257,"domainLookupStart":326.09999990463257,"fetchStart":326.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":326.09999990463257,"responseEnd":866.7999999523163,"responseStart":866.7999999523163,"secureConnectionStart":326.09999990463257},{"duration":869.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":326.09999990463257,"connectEnd":326.09999990463257,"connectStart":326.09999990463257,"domainLookupEnd":326.09999990463257,"domainLookupStart":326.09999990463257,"fetchStart":326.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":326.09999990463257,"responseEnd":1195.5999999046326,"responseStart":1195.5999999046326,"secureConnectionStart":326.09999990463257},{"duration":124.79999995231628,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":743,"connectEnd":743,"connectStart":743,"domainLookupEnd":743,"domainLookupStart":743,"fetchStart":743,"redirectEnd":0,"redirectStart":0,"requestStart":743,"responseEnd":867.7999999523163,"responseStart":867.7999999523163,"secureConnectionStart":743},{"duration":206.29999995231628,"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&whisper-enabled=true","startTime":1000.7999999523163,"connectEnd":1000.7999999523163,"connectStart":1000.7999999523163,"domainLookupEnd":1000.7999999523163,"domainLookupStart":1000.7999999523163,"fetchStart":1000.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":1000.7999999523163,"responseEnd":1207.0999999046326,"responseStart":1207.0999999046326,"secureConnectionStart":1000.7999999523163},{"duration":260.39999985694885,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1040,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1040,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1300.3999998569489,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":123,"responseStart":301,"responseEnd":325,"domLoading":304,"domInteractive":1247,"domContentLoadedEventStart":1247,"domContentLoadedEventEnd":1300,"domComplete":1518,"loadEventStart":1518,"loadEventEnd":1519,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1225.2000000476837},{"name":"bigPipe.sidebar-id.end","time":1226.0999999046326},{"name":"bigPipe.activity-panel-pipe-id.start","time":1226.3999998569489},{"name":"bigPipe.activity-panel-pipe-id.end","time":1227.3999998569489},{"name":"activityTabFullyLoaded","time":1312.7000000476837}],"measures":[],"correlationId":"4ae1a6a3ef0c9","effectiveType":"4g","downlink":9.8,"rtt":0,"serverDuration":95,"dbReadsTimeInMs":13,"dbConnsTimeInMs":23,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
The patch fixing this bug was pushed into bb-10.2-ext.