Type:
Bug
Priority:
Major
Resolution:
Duplicate
Affects Version/s:
10.5
SET optimizer_switch= 'rowid_filter=on' ;
create table t1 (pk int not null primary key , i1 varchar (10), i2 int , i3 int , key i2 (i2), key (i2,i3,pk)) engine=myisam;
insert into t1 values (45, null , null , null ),(46, null , null , null ),(44, null , null , null ),(43, null , null , null ),(49, null , null , null ),(50, null , null , null ),(51, null , null , null ),(52, null , null , null ),(53, null , null , null ),(54, null , null , null ),(55, null , null , null ),(56, null , null , null ),(57, null , null , null ),(58, null , null , null ),(59, null , null , null ),(60, null , null , null ),(61, null , null , null ),(62, null , null , null ),(63, null , null , null ),(64, null , null , null ),(65, null , null , null );
select straight_join 1
from t1 join t1 as a2 on t1.i1 = a2.i1
where a2.pk > 4 and a2.pk < 6
and a2.i3 >= 2 and a2.i2 in (4, 6, 7);
10.5 0eab87cef26eaac2c
#4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#5 0x00007f3f7238b535 in __GI_abort () at abort.c:79
#6 0x00007f3f7238b40f in __assert_fail_base (fmt=0x7f3f724edee0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x560604d4612f "tmp >= 0", file=0x560604d44e78 "/10.5/sql/sql_select.cc", line=7977, function=<optimized out>) at assert.c:92
#7 0x00007f3f72399102 in __GI___assert_fail (assertion=0x560604d4612f "tmp >= 0", file=0x560604d44e78 "/10.5/sql/sql_select.cc", line=7977, function=0x560604d49b00 <best_access_path(JOIN*, st_join_table*, unsigned long long, st_position const*, unsigned int, bool, double, st_position*, st_position*)::__PRETTY_FUNCTION__> "void best_access_path(JOIN*, JOIN_TAB*, table_map, const POSITION*, uint, bool, double, POSITION*, POSITION*)") at assert.c:101
#8 0x000056060400adc4 in best_access_path (join=0x7f3f5c017988, s=0x7f3f5c018af0, remaining_tables=2, join_positions=0x7f3f5c0190b8, idx=1, disable_jbuf=false, record_count=21, pos=0x7f3f5c0191e8, loose_scan_pos=0x7f3f6cd4b140) at /10.5/sql/sql_select.cc:7977
#9 0x000056060400c790 in optimize_straight_join (join=0x7f3f5c017988, join_tables=2) at /10.5/sql/sql_select.cc:8596
#10 0x000056060400be58 in choose_plan (join=0x7f3f5c017988, join_tables=3) at /10.5/sql/sql_select.cc:8299
#11 0x0000560604003ad1 in make_join_statistics (join=0x7f3f5c017988, tables_list=..., keyuse_array=0x7f3f5c017c78) at /10.5/sql/sql_select.cc:5554
#12 0x0000560603ff7962 in JOIN::optimize_inner (this=0x7f3f5c017988) at /10.5/sql/sql_select.cc:2260
#13 0x0000560603ff5282 in JOIN::optimize (this=0x7f3f5c017988) at /10.5/sql/sql_select.cc:1606
#14 0x00005606040006cb in mysql_select (thd=0x7f3f5c000d78, tables=0x7f3f5c014258, fields=..., conds=0x7f3f5c016588, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748610, result=0x7f3f5c017960, unit=0x7f3f5c004d80, select_lex=0x7f3f5c013d00) at /10.5/sql/sql_select.cc:4654
#15 0x0000560603ff042a in handle_select (thd=0x7f3f5c000d78, lex=0x7f3f5c004cb8, result=0x7f3f5c017960, setup_tables_done_option=0) at /10.5/sql/sql_select.cc:417
#16 0x0000560603fb5c83 in execute_sqlcom_select (thd=0x7f3f5c000d78, all_tables=0x7f3f5c014258) at /10.5/sql/sql_parse.cc:6168
#17 0x0000560603fac7c2 in mysql_execute_command (thd=0x7f3f5c000d78) at /10.5/sql/sql_parse.cc:3901
#18 0x0000560603fbabb2 in mysql_parse (thd=0x7f3f5c000d78, rawbuf=0x7f3f5c013b90 "select straight_join 1 \nfrom t1 join t1 as a2 on t1.i1 = a2.i1\nwhere a2.pk > 4 and a2.pk < 6\nand a2.i3 >= 2 and a2.i2 in (4, 6, 7)", length=131, parser_state=0x7f3f6cd4c510, is_com_multi=false, is_next_command=false) at /10.5/sql/sql_parse.cc:7953
#19 0x0000560603fa6546 in dispatch_command (command=COM_QUERY, thd=0x7f3f5c000d78, packet=0x7f3f5c008d09 "select straight_join 1 \nfrom t1 join t1 as a2 on t1.i1 = a2.i1\nwhere a2.pk > 4 and a2.pk < 6\nand a2.i3 >= 2 and a2.i2 in (4, 6, 7)", packet_length=131, is_com_multi=false, is_next_command=false) at /10.5/sql/sql_parse.cc:1839
#20 0x0000560603fa4c84 in do_command (thd=0x7f3f5c000d78) at /10.5/sql/sql_parse.cc:1358
#21 0x00005606041464f2 in do_handle_one_connection (connect=0x56060863f778, put_in_cache=true) at /10.5/sql/sql_connect.cc:1422
#22 0x0000560604146222 in handle_one_connection (arg=0x56060855ec18) at /10.5/sql/sql_connect.cc:1319
#23 0x0000560604675181 in pfs_spawn_thread (arg=0x56060863f3b8) at /10.5/storage/perfschema/pfs.cc:2201
#24 0x00007f3f72e31fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
#25 0x00007f3f724624cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
{"report":{"fcp":776.1000000238419,"ttfb":131.89999997615814,"pageVisibility":"visible","entityId":85182,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"c296460c-7847-4b31-8461-e0add1eeba06","navigationType":0,"readyForUser":844.3999999761581,"redirectCount":0,"resourceLoadedEnd":1241.6000000238419,"resourceLoadedStart":137,"resourceTiming":[{"duration":174.30000007152557,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":137,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":137,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":311.3000000715256,"responseStart":0,"secureConnectionStart":0},{"duration":174.09999990463257,"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":137.30000007152557,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":137.30000007152557,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":311.39999997615814,"responseStart":0,"secureConnectionStart":0},{"duration":233.20000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":137.39999997615814,"connectEnd":137.39999997615814,"connectStart":137.39999997615814,"domainLookupEnd":137.39999997615814,"domainLookupStart":137.39999997615814,"fetchStart":137.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":137.39999997615814,"responseEnd":370.60000002384186,"responseStart":370.60000002384186,"secureConnectionStart":137.39999997615814},{"duration":259.2000000476837,"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":137.5,"connectEnd":137.5,"connectStart":137.5,"domainLookupEnd":137.5,"domainLookupStart":137.5,"fetchStart":137.5,"redirectEnd":0,"redirectStart":0,"requestStart":137.5,"responseEnd":396.7000000476837,"responseStart":396.7000000476837,"secureConnectionStart":137.5},{"duration":262.89999997615814,"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":137.60000002384186,"connectEnd":137.60000002384186,"connectStart":137.60000002384186,"domainLookupEnd":137.60000002384186,"domainLookupStart":137.60000002384186,"fetchStart":137.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":137.60000002384186,"responseEnd":400.5,"responseStart":400.5,"secureConnectionStart":137.60000002384186},{"duration":263.1999999284744,"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":137.70000004768372,"connectEnd":137.70000004768372,"connectStart":137.70000004768372,"domainLookupEnd":137.70000004768372,"domainLookupStart":137.70000004768372,"fetchStart":137.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":137.70000004768372,"responseEnd":400.89999997615814,"responseStart":400.89999997615814,"secureConnectionStart":137.70000004768372},{"duration":263.89999997615814,"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":137.80000007152557,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":137.80000007152557,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":401.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":263.5,"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":137.80000007152557,"connectEnd":137.80000007152557,"connectStart":137.80000007152557,"domainLookupEnd":137.80000007152557,"domainLookupStart":137.80000007152557,"fetchStart":137.80000007152557,"redirectEnd":0,"redirectStart":0,"requestStart":137.80000007152557,"responseEnd":401.3000000715256,"responseStart":401.3000000715256,"secureConnectionStart":137.80000007152557},{"duration":263.7000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":138,"connectEnd":138,"connectStart":138,"domainLookupEnd":138,"domainLookupStart":138,"fetchStart":138,"redirectEnd":0,"redirectStart":0,"requestStart":138,"responseEnd":401.7000000476837,"responseStart":401.7000000476837,"secureConnectionStart":138},{"duration":263.89999997615814,"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":138.10000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":138.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":402,"responseStart":0,"secureConnectionStart":0},{"duration":264,"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":138.20000004768372,"connectEnd":138.20000004768372,"connectStart":138.20000004768372,"domainLookupEnd":138.20000004768372,"domainLookupStart":138.20000004768372,"fetchStart":138.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":138.20000004768372,"responseEnd":402.2000000476837,"responseStart":402.2000000476837,"secureConnectionStart":138.20000004768372},{"duration":946.2000000476837,"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":143.60000002384186,"connectEnd":143.60000002384186,"connectStart":143.60000002384186,"domainLookupEnd":143.60000002384186,"domainLookupStart":143.60000002384186,"fetchStart":143.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":143.60000002384186,"responseEnd":1089.8000000715256,"responseStart":1089.8000000715256,"secureConnectionStart":143.60000002384186},{"duration":1097.8999999761581,"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":143.70000004768372,"connectEnd":143.70000004768372,"connectStart":143.70000004768372,"domainLookupEnd":143.70000004768372,"domainLookupStart":143.70000004768372,"fetchStart":143.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":143.70000004768372,"responseEnd":1241.6000000238419,"responseStart":1241.6000000238419,"secureConnectionStart":143.70000004768372},{"duration":653.4000000953674,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":585.3999999761581,"connectEnd":585.3999999761581,"connectStart":585.3999999761581,"domainLookupEnd":585.3999999761581,"domainLookupStart":585.3999999761581,"fetchStart":585.3999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":585.3999999761581,"responseEnd":1238.8000000715256,"responseStart":1238.8000000715256,"secureConnectionStart":585.3999999761581},{"duration":487,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":756.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":756.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1243.5,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":5,"responseStart":132,"responseEnd":136,"domLoading":135,"domInteractive":1277,"domContentLoadedEventStart":1277,"domContentLoadedEventEnd":1312,"domComplete":1719,"loadEventStart":1719,"loadEventEnd":1721,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1246.5},{"name":"bigPipe.sidebar-id.end","time":1247.3999999761581},{"name":"bigPipe.activity-panel-pipe-id.start","time":1247.5},{"name":"bigPipe.activity-panel-pipe-id.end","time":1249.8000000715256},{"name":"activityTabFullyLoaded","time":1318.8000000715256}],"measures":[],"correlationId":"adcc28ea1f60b4","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":72,"dbReadsTimeInMs":11,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}