Type:
Bug
Priority:
Critical
Resolution:
Fixed
Affects Version/s:
N/A
SET max_statement_time= 2; # Just so that if it hangs, then not forever
DROP TABLE IF EXISTS t3;
CREATE TABLE t (c CHAR (8), KEY (c DESC )) ENGINE=MyISAM CHARACTER SET utf8mb4;
INSERT INTO t VALUES ( '' ),( 'foo' ),( NULL ),( '' ),( 'bar' );
SELECT DISTINCT c FROM t;
SELECT c FROM t;
# Cleanup
DROP TABLE t;
The first query returns three values, without NULL:
preview-10.8-MDEV-13756-desc-indexes 47c18283
SELECT DISTINCT c FROM t;
c
bar
foo
If count is added, it claims there are 3 empty strings instead of 2.
The second query, plain SELECT without DISTINCT, hangs (subject to max_statement_time).
Reproducible with MyISAM and Aria. Not reproducible with InnoDB.
Reproducible with big5, utf8mb4, utf8mb3. Not reproducible with latin1. I didn't try other charsets.
Not reproducible without DESC index.
Elena Stepanova
made changes -
2021-12-21 16:48
Summary
NULL gets lost, SELECT hangs with DESC index on MyISAM/Aria table
NULL gets lost (becomes empty string), SELECT hangs with DESC index on MyISAM/Aria table
Elena Stepanova
made changes -
2021-12-21 16:49
Description
{code:sql}
SET max_statement_time= 2; # Just so that if it hangs, then not forever
DROP TABLE IF EXISTS t3;
CREATE TABLE t (c CHAR(8), KEY(c DESC)) ENGINE=MyISAM CHARACTER SET utf8mb4;
INSERT INTO t VALUES (''),('foo'),(NULL),(''),('bar');
SELECT DISTINCT c FROM t;
SELECT c FROM t;
# Cleanup
DROP TABLE t;
{code}
The first query returns three values, without NULL:
{code:sql|title=preview-10.8-MDEV-13756 -desc-indexes 47c18283}
SELECT DISTINCT c FROM t;
c
bar
foo
{code}
The second query, plain SELECT without DISTINCT, hangs (subject to max_statement_time).
Reproducible with MyISAM and Aria. Not reproducible with InnoDB.
Reproducible with big5, utf8mb4, utf8mb3. Not reproducible with latin1. I didn't try other charsets.
Not reproducible without DESC index.
{code:sql}
SET max_statement_time= 2; # Just so that if it hangs, then not forever
DROP TABLE IF EXISTS t3;
CREATE TABLE t (c CHAR(8), KEY(c DESC)) ENGINE=MyISAM CHARACTER SET utf8mb4;
INSERT INTO t VALUES (''),('foo'),(NULL),(''),('bar');
SELECT DISTINCT c FROM t;
SELECT c FROM t;
# Cleanup
DROP TABLE t;
{code}
The first query returns three values, without NULL:
{code:sql|title=preview-10.8-MDEV-13756 -desc-indexes 47c18283}
SELECT DISTINCT c FROM t;
c
bar
foo
{code}
If count is added, it claims there are 3 empty strings instead of 2.
The second query, plain SELECT without DISTINCT, hangs (subject to max_statement_time).
Reproducible with MyISAM and Aria. Not reproducible with InnoDB.
Reproducible with big5, utf8mb4, utf8mb3. Not reproducible with latin1. I didn't try other charsets.
Not reproducible without DESC index.
Sergei Golubchik
made changes -
2021-12-25 23:20
Status
Open
[ 1
]
In Progress
[ 3
]
Sergei Golubchik
made changes -
2021-12-25 23:20
Status
In Progress
[ 3
]
Stalled
[ 10000
]
Sergei Golubchik
made changes -
2021-12-27 21:11
Status
Stalled
[ 10000
]
In Testing
[ 10301
]
Sergei Golubchik
made changes -
2022-01-26 20:42
Fix Version/s
10.8.1
[ 26815
]
Fix Version/s
10.8
[ 26121
]
Resolution
Fixed
[ 1
]
Status
In Testing
[ 10301
]
Closed
[ 6
]
{"report":{"fcp":1188.3999996185303,"ttfb":442.8999996185303,"pageVisibility":"visible","entityId":106185,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"9cb8f066-a521-44c7-9706-2addfad3861b","navigationType":0,"readyForUser":1286.0999999046326,"redirectCount":0,"resourceLoadedEnd":1405.8999996185303,"resourceLoadedStart":447.7999997138977,"resourceTiming":[{"duration":209.40000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":447.7999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":447.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":657.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":209.40000009536743,"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":448.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":448.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":657.5,"responseStart":0,"secureConnectionStart":0},{"duration":260,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":448.19999980926514,"connectEnd":448.19999980926514,"connectStart":448.19999980926514,"domainLookupEnd":448.19999980926514,"domainLookupStart":448.19999980926514,"fetchStart":448.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":448.19999980926514,"responseEnd":708.1999998092651,"responseStart":708.1999998092651,"secureConnectionStart":448.19999980926514},{"duration":302.19999980926514,"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":453,"connectEnd":453,"connectStart":453,"domainLookupEnd":453,"domainLookupStart":453,"fetchStart":453,"redirectEnd":0,"redirectStart":0,"requestStart":453,"responseEnd":755.1999998092651,"responseStart":755.1999998092651,"secureConnectionStart":453},{"duration":306.09999990463257,"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":453.2999997138977,"connectEnd":453.2999997138977,"connectStart":453.2999997138977,"domainLookupEnd":453.2999997138977,"domainLookupStart":453.2999997138977,"fetchStart":453.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":453.2999997138977,"responseEnd":759.3999996185303,"responseStart":759.3999996185303,"secureConnectionStart":453.2999997138977},{"duration":306.3999996185303,"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":453.5,"connectEnd":453.5,"connectStart":453.5,"domainLookupEnd":453.5,"domainLookupStart":453.5,"fetchStart":453.5,"redirectEnd":0,"redirectStart":0,"requestStart":453.5,"responseEnd":759.8999996185303,"responseStart":759.8999996185303,"secureConnectionStart":453.5},{"duration":306.5,"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":453.69999980926514,"connectEnd":453.69999980926514,"connectStart":453.69999980926514,"domainLookupEnd":453.69999980926514,"domainLookupStart":453.69999980926514,"fetchStart":453.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":453.69999980926514,"responseEnd":760.1999998092651,"responseStart":760.1999998092651,"secureConnectionStart":453.69999980926514},{"duration":403.80000019073486,"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":453.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":453.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":857.6999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":306.7999997138977,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":454,"connectEnd":454,"connectStart":454,"domainLookupEnd":454,"domainLookupStart":454,"fetchStart":454,"redirectEnd":0,"redirectStart":0,"requestStart":454,"responseEnd":760.7999997138977,"responseStart":760.7999997138977,"secureConnectionStart":454},{"duration":403.80000019073486,"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":454.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":454.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":858,"responseStart":0,"secureConnectionStart":0},{"duration":306.90000009536743,"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":454.3999996185303,"connectEnd":454.3999996185303,"connectStart":454.3999996185303,"domainLookupEnd":454.3999996185303,"domainLookupStart":454.3999996185303,"fetchStart":454.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":454.3999996185303,"responseEnd":761.2999997138977,"responseStart":761.2999997138977,"secureConnectionStart":454.3999996185303},{"duration":537.3000001907349,"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":456.19999980926514,"connectEnd":456.19999980926514,"connectStart":456.19999980926514,"domainLookupEnd":456.19999980926514,"domainLookupStart":456.19999980926514,"fetchStart":456.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":456.19999980926514,"responseEnd":993.5,"responseStart":993.5,"secureConnectionStart":456.19999980926514},{"duration":889.2999997138977,"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":459,"connectEnd":459,"connectStart":459,"domainLookupEnd":459,"domainLookupStart":459,"fetchStart":459,"redirectEnd":0,"redirectStart":0,"requestStart":459,"responseEnd":1348.2999997138977,"responseStart":1348.2999997138977,"secureConnectionStart":459},{"duration":144.59999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":875.7999997138977,"connectEnd":875.7999997138977,"connectStart":875.7999997138977,"domainLookupEnd":875.7999997138977,"domainLookupStart":875.7999997138977,"fetchStart":875.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":875.7999997138977,"responseEnd":1020.3999996185303,"responseStart":1020.3999996185303,"secureConnectionStart":875.7999997138977},{"duration":230.59999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":1139.1999998092651,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1139.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1369.7999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":231.40000009536743,"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":1140.1999998092651,"connectEnd":1140.1999998092651,"connectStart":1140.1999998092651,"domainLookupEnd":1140.1999998092651,"domainLookupStart":1140.1999998092651,"fetchStart":1140.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":1140.1999998092651,"responseEnd":1371.5999999046326,"responseStart":1371.5999999046326,"secureConnectionStart":1140.1999998092651},{"duration":265.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/097ae97cb8fbec7d6ea4bbb1f26955b9-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":1140.7999997138977,"connectEnd":1140.7999997138977,"connectStart":1140.7999997138977,"domainLookupEnd":1140.7999997138977,"domainLookupStart":1140.7999997138977,"fetchStart":1140.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":1140.7999997138977,"responseEnd":1405.8999996185303,"responseStart":1405.8999996185303,"secureConnectionStart":1140.7999997138977},{"duration":234.39999961853027,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1182,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1182,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1416.3999996185303,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":239,"responseStart":443,"responseEnd":459,"domLoading":446,"domInteractive":1417,"domContentLoadedEventStart":1417,"domContentLoadedEventEnd":1465,"domComplete":1700,"loadEventStart":1700,"loadEventEnd":1700,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1381.2999997138977},{"name":"bigPipe.sidebar-id.end","time":1382.0999999046326},{"name":"bigPipe.activity-panel-pipe-id.start","time":1382.2999997138977},{"name":"bigPipe.activity-panel-pipe-id.end","time":1385.5999999046326},{"name":"activityTabFullyLoaded","time":1481.6999998092651}],"measures":[],"correlationId":"ce303f1d42323a","effectiveType":"4g","downlink":9.5,"rtt":0,"serverDuration":139,"dbReadsTimeInMs":26,"dbConnsTimeInMs":38,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
pushed into preview-10.8-
MDEV-13756-desc-indexes