Type:
Bug
Priority:
Critical
Resolution:
Fixed
Affects Version/s:
N/A
Notes:
Fix for MDEV-30088 is already in the branch
The failure is sporadic, run with --repeat=N . It usually fails for me within 5 attempts, but it can vary on different machines and builds.
--source include/have_innodb.inc
CREATE TABLE t (a CHAR (8), b INT , c TIMESTAMP , KEY (b,c)) ENGINE=InnoDB;
INSERT INTO t VALUES
( 'g' ,1, '1980-09-26' ),( 'l' ,2, '1979-10-07' ),( 'e' ,3, '1992-04-22' ),
( 'v' ,9, '1975-09-21' ),( 'w' ,3, '1973-10-06' ),( 'y' ,8, '1986-10-28' ),
( 'a' ,4, '2015-02-15' ),( 'v' ,9, '1980-01-13' ),( 'f' ,1, '1972-02-27' ),
( 'z' ,7, '1981-05-25' ),( 'z' ,8, '1980-06-14' ),( 'c' ,9, '1985-01-24' ),
( 'x' ,5, '1999-12-14' ),( 'h' ,3, '1994-12-18' ),( 'j' ,6, '1985-08-17' ),
( 'b' ,6, '1989-08-02' ),( 'h' ,6, '2024-07-06' ),( 'h' ,4, '2024-02-10' ),
( 's' ,1, '1981-07-21' ),( 'c' ,2, '1988-09-16' ),( 'e' ,3, '1981-08-26' ),
( 'a' ,2, '1986-05-23' ),( 'l' ,0, '1997-12-19' ),( 'b' ,5, '2018-05-01' ),
( 'q' ,2, '1990-01-01' ),( 'v' ,9, '1982-10-12' ),( 'x' ,2, '2005-04-29' ),
( 'f' ,8, '2005-08-20' ),( 'd' ,3, '2002-01-24' ),( 'b' ,9, '1982-02-04' ),
( 'a' ,4, '1978-04-12' ),( 'c' ,9, '1984-06-08' ),( 'n' ,9, '1983-10-19' ),
( 'l' ,1, '2023-01-05' ),( 'f' ,2, '1988-11-18' ),( 'a' ,9, '1977-11-11' ),
( 'k' ,2, '1980-09-27' ),( 'i' ,7, '1988-08-09' ),( 'e' ,4, '1992-07-30' ),
( 'l' ,5, '1980-01-01' ),( 'h' ,5, '2011-12-24' ),( 'd' ,6, '2035-03-28' ),
( 'h' ,7, '1994-05-14' ),( 'y' ,1, '1990-01-01' ),( 'x' ,6, '1981-09-12' ),
( 'x' ,9, '1980-01-01' ),( 's' ,9, '1995-11-09' ),( 'i' ,4, '1980-01-01' ),
( 'p' ,4, '1980-01-01' ),( 'a' ,6, '2026-05-05' ),( 'c' ,6, '1991-09-23' ),
( 'l' ,8, '1980-01-01' ),( 'n' ,4, '1999-09-15' ),( 'b' ,1, '2011-07-23' ),
( 'a' ,9, '1980-01-01' ),( 'a' ,0, '1977-12-21' ),( 'v' ,6, '1986-10-29' ),
( 'r' ,0, '1997-03-27' ),( 'a' ,9, '2000-05-05' ),( 'x' ,1, '1990-01-01' ),
( 'n' ,7, '1985-08-01' ),( 'm' ,6, '1994-09-14' ),( 's' ,9, '2009-09-27' ),
( 'r' ,8, '2028-10-30' ),( 'e' ,6, '1982-08-31' ),( 'x' ,0, '1989-12-21' ),
( 'd' ,0, '1984-06-24' ),( 'r' ,6, '1982-02-11' ),( 'a' ,3, '1997-10-22' ),
( 's' ,9, '2007-08-29' ),( 'a' ,3, '1990-01-01' ),( 'o' ,1, '2015-02-10' ),
( 'x' ,0, '1978-08-30' ),( 'k' ,5, '1989-06-15' ),( 'b' ,0, '1984-08-21' ),
( 'v' ,0, '1990-01-01' ),( 'a' ,9, '1993-06-23' ),( 'n' ,5, '1979-11-10' ),
( 'o' ,8, '2024-08-31' ),( 'k' ,6, '1983-12-25' ),( 'y' ,5, '2013-02-19' ),
( 'a' ,9, '1989-12-03' ),( 'k' ,4, '1973-08-07' ),( 'o' ,7, '1988-03-19' ),
( 'o' ,3, '2007-01-07' ),( 't' ,6, '1990-02-22' ),( 'f' ,4, '2032-10-22' ),
( 'p' ,0, '1977-09-12' ),( 'f' ,3, '2036-11-26' ),( 'a' ,9, '2008-06-26' ),
( 'k' ,2, '2004-09-11' ),( 'x' ,1, '2005-07-28' ),( 's' ,8, '2027-08-28' ),
( 'a' ,8, '2000-06-11' ),( 'a' ,7, '2005-05-20' ),( 'u' ,9, '1980-01-01' ),
( 'v' ,5, '1990-01-01' ),( 'x' ,7, '1984-11-01' ),( 'a' ,1, '2006-05-14' );
SELECT b FROM t WHERE a > 'a' GROUP BY b HAVING b >= 6 OR b <= 0;
# Cleanup
DROP TABLE t;
bb-11.0 552965e1c1
mariadbd: /data/src/bb-11.0/sql/sql_select.cc:30327: bool get_range_limit_read_cost(const POSITION*, const TABLE*, uint, ha_rows, ha_rows, double*, double*): Assertion `cond_selectivity <= 1.0' failed.
221228 21:46:27 [ERROR] mysqld got signal 6 ;
#7 0x00007f01df0b2662 in __GI___assert_fail (assertion=0x55c3ace16713 "cond_selectivity <= 1.0", file=0x55c3ace10ca8 "/data/src/bb-11.0/sql/sql_select.cc", line=30327, function=0x55c3ace16730 "bool get_range_limit_read_cost(const POSITION*, const TABLE*, uint, ha_rows, ha_rows, double*, double*)") at assert.c:101
#8 0x000055c3ab6a6b5c in get_range_limit_read_cost (pos=0x7f01a8018fd8, table=0x7f01a8227398, keynr=0, rows_limit_arg=100, rows_to_scan=100, read_cost=0x7f01d15f3120, read_rows=0x7f01d15f3128) at /data/src/bb-11.0/sql/sql_select.cc:30327
#9 0x000055c3ab6a87d0 in test_if_cheaper_ordering (tab=0x7f01a8231b00, order=0x7f01a80167b8, table=0x7f01a8227398, usable_keys=..., ref_key=-1, select_limit_arg=100, new_key=0x7f01d15f32e8, new_key_direction=0x7f01d15f32f4, new_select_limit=0x7f01d15f32b8, new_used_key_parts=0x7f01d15f32ec, saved_best_key_parts=0x7f01d15f32f0) at /data/src/bb-11.0/sql/sql_select.cc:30686
#10 0x000055c3ab68cdf8 in test_if_skip_sort_order (tab=0x7f01a8231b00, order=0x7f01a80167b8, select_limit=18446744073709551615, no_changes=false, map=0x7f01a8227428) at /data/src/bb-11.0/sql/sql_select.cc:25595
#11 0x000055c3ab61ac84 in JOIN::optimize_stage2 (this=0x7f01a80179b0) at /data/src/bb-11.0/sql/sql_select.cc:3278
#12 0x000055c3ab616267 in JOIN::optimize_inner (this=0x7f01a80179b0) at /data/src/bb-11.0/sql/sql_select.cc:2594
#13 0x000055c3ab61167a in JOIN::optimize (this=0x7f01a80179b0) at /data/src/bb-11.0/sql/sql_select.cc:1899
#14 0x000055c3ab6272b7 in mysql_select (thd=0x7f01a8000db8, tables=0x7f01a8015b88, fields=..., conds=0x7f01a8016468, og_num=1, order=0x0, group=0x7f01a80167b8, having=0x7f01a8016f90, proc_param=0x0, select_options=2164525824, result=0x7f01a8017988, unit=0x7f01a8005210, select_lex=0x7f01a80155a0) at /data/src/bb-11.0/sql/sql_select.cc:5112
#15 0x000055c3ab607b05 in handle_select (thd=0x7f01a8000db8, lex=0x7f01a8005138, result=0x7f01a8017988, setup_tables_done_option=0) at /data/src/bb-11.0/sql/sql_select.cc:609
#16 0x000055c3ab55d18f in execute_sqlcom_select (thd=0x7f01a8000db8, all_tables=0x7f01a8015b88) at /data/src/bb-11.0/sql/sql_parse.cc:6263
#17 0x000055c3ab549b91 in mysql_execute_command (thd=0x7f01a8000db8, is_called_from_prepared_stmt=false) at /data/src/bb-11.0/sql/sql_parse.cc:3947
#18 0x000055c3ab5662ae in mysql_parse (thd=0x7f01a8000db8, rawbuf=0x7f01a80154c0 "SELECT b FROM t WHERE a > 'a' GROUP BY b HAVING b >= 6 OR b <= 0", length=64, parser_state=0x7f01d15f4390) at /data/src/bb-11.0/sql/sql_parse.cc:7998
#19 0x000055c3ab53d756 in dispatch_command (command=COM_QUERY, thd=0x7f01a8000db8, packet=0x7f01a800ba49 "SELECT b FROM t WHERE a > 'a' GROUP BY b HAVING b >= 6 OR b <= 0", packet_length=64, blocking=true) at /data/src/bb-11.0/sql/sql_parse.cc:1894
#20 0x000055c3ab53a911 in do_command (thd=0x7f01a8000db8, blocking=true) at /data/src/bb-11.0/sql/sql_parse.cc:1407
#21 0x000055c3ab8b2c98 in do_handle_one_connection (connect=0x55c3b0effe98, put_in_cache=true) at /data/src/bb-11.0/sql/sql_connect.cc:1415
#22 0x000055c3ab8b268e in handle_one_connection (arg=0x55c3b0eed328) at /data/src/bb-11.0/sql/sql_connect.cc:1317
#23 0x000055c3ac1cad07 in pfs_spawn_thread (arg=0x55c3b0effa08) at /data/src/bb-11.0/storage/perfschema/pfs.cc:2201
#24 0x00007f01df58eea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
#25 0x00007f01df17daef in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Could not reproduce on the baseline.
is caused by
MDEV-26974
Improve selectivity and related costs in optimizer
Closed
{"report":{"fcp":1008.5999999046326,"ttfb":146.19999980926514,"pageVisibility":"visible","entityId":117925,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"b1605bf5-ffd6-4587-927b-9f57194829be","navigationType":0,"readyForUser":1096.5,"redirectCount":0,"resourceLoadedEnd":1239.5,"resourceLoadedStart":152.59999990463257,"resourceTiming":[{"duration":385.2999999523163,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":152.59999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":152.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":537.8999998569489,"responseStart":0,"secureConnectionStart":0},{"duration":385,"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":152.89999985694885,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":152.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":537.8999998569489,"responseStart":0,"secureConnectionStart":0},{"duration":393.7999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":153.09999990463257,"connectEnd":153.09999990463257,"connectStart":153.09999990463257,"domainLookupEnd":153.09999990463257,"domainLookupStart":153.09999990463257,"fetchStart":153.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":153.09999990463257,"responseEnd":546.8999998569489,"responseStart":546.8999998569489,"secureConnectionStart":153.09999990463257},{"duration":418.7000000476837,"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":153.09999990463257,"connectEnd":153.09999990463257,"connectStart":153.09999990463257,"domainLookupEnd":153.09999990463257,"domainLookupStart":153.09999990463257,"fetchStart":153.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":153.09999990463257,"responseEnd":571.7999999523163,"responseStart":571.7999999523163,"secureConnectionStart":153.09999990463257},{"duration":422.30000019073486,"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":153.19999980926514,"connectEnd":153.19999980926514,"connectStart":153.19999980926514,"domainLookupEnd":153.19999980926514,"domainLookupStart":153.19999980926514,"fetchStart":153.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":153.19999980926514,"responseEnd":575.5,"responseStart":575.5,"secureConnectionStart":153.19999980926514},{"duration":422.7000000476837,"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":153.39999985694885,"connectEnd":153.39999985694885,"connectStart":153.39999985694885,"domainLookupEnd":153.39999985694885,"domainLookupStart":153.39999985694885,"fetchStart":153.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":153.39999985694885,"responseEnd":576.0999999046326,"responseStart":576.0999999046326,"secureConnectionStart":153.39999985694885},{"duration":424,"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":153.39999985694885,"connectEnd":153.39999985694885,"connectStart":153.39999985694885,"domainLookupEnd":153.39999985694885,"domainLookupStart":153.39999985694885,"fetchStart":153.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":153.39999985694885,"responseEnd":577.3999998569489,"responseStart":577.3999998569489,"secureConnectionStart":153.39999985694885},{"duration":424.89999985694885,"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":153.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":153.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":578.3999998569489,"responseStart":0,"secureConnectionStart":0},{"duration":424.7000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":153.69999980926514,"connectEnd":153.69999980926514,"connectStart":153.69999980926514,"domainLookupEnd":153.69999980926514,"domainLookupStart":153.69999980926514,"fetchStart":153.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":153.69999980926514,"responseEnd":578.3999998569489,"responseStart":578.3999998569489,"secureConnectionStart":153.69999980926514},{"duration":425.7000000476837,"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":153.79999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":153.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":579.5,"responseStart":0,"secureConnectionStart":0},{"duration":425.7000000476837,"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":153.89999985694885,"connectEnd":153.89999985694885,"connectStart":153.89999985694885,"domainLookupEnd":153.89999985694885,"domainLookupStart":153.89999985694885,"fetchStart":153.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":153.89999985694885,"responseEnd":579.5999999046326,"responseStart":579.5999999046326,"secureConnectionStart":153.89999985694885},{"duration":567.8000001907349,"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":159.69999980926514,"connectEnd":159.69999980926514,"connectStart":159.69999980926514,"domainLookupEnd":159.69999980926514,"domainLookupStart":159.69999980926514,"fetchStart":159.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":159.69999980926514,"responseEnd":727.5,"responseStart":727.5,"secureConnectionStart":159.69999980926514},{"duration":1079.7000000476837,"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":159.79999995231628,"connectEnd":159.79999995231628,"connectStart":159.79999995231628,"domainLookupEnd":159.79999995231628,"domainLookupStart":159.79999995231628,"fetchStart":159.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":159.79999995231628,"responseEnd":1239.5,"responseStart":1239.5,"secureConnectionStart":159.79999995231628},{"duration":423.7999999523163,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":777.2999999523163,"connectEnd":777.2999999523163,"connectStart":777.2999999523163,"domainLookupEnd":777.2999999523163,"domainLookupStart":777.2999999523163,"fetchStart":777.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":777.2999999523163,"responseEnd":1201.0999999046326,"responseStart":1201.0999999046326,"secureConnectionStart":777.2999999523163}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":10,"responseStart":146,"responseEnd":154,"domLoading":149,"domInteractive":1260,"domContentLoadedEventStart":1260,"domContentLoadedEventEnd":1300,"domComplete":2340,"loadEventStart":2340,"loadEventEnd":2342,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1244.2999999523163},{"name":"bigPipe.sidebar-id.end","time":1245.0999999046326},{"name":"bigPipe.activity-panel-pipe-id.start","time":1245.2999999523163},{"name":"bigPipe.activity-panel-pipe-id.end","time":1247.5999999046326},{"name":"activityTabFullyLoaded","time":1308}],"measures":[],"correlationId":"a8a5168cf44589","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":73,"dbReadsTimeInMs":10,"dbConnsTimeInMs":17,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}