This script:
DROP TABLE IF EXISTS t1;
|
CREATE TABLE t1 (a VARCHAR(10) COLLATE latin1_bin);
|
INSERT INTO t1 VALUES ('a'),('a ');
|
SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ';
|
returns one row:
+------+-----------+
|
| a | LENGTH(a) |
|
+------+-----------+
|
| a | 1 |
|
+------+-----------+
|
Now if I make the condition even stronger:
SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a';
|
it erroneously returns 2 rows:
+------+-----------+
|
| a | LENGTH(a) |
|
+------+-----------+
|
| a | 1 |
|
| a | 2 |
|
+------+-----------+
|
The problem happens in equal fields propagation.
WHERE a NOT LIKE 'a ' AND a='a'
|
gets rewritten to
WHERE 'a' NOT LIKE 'a ' AND a='a'
|
then LIKE gets removed from the condition.
- blocks
-
MDEV-8728
Fix a number of problems in equal field and equal expression propagation
-
-
Closed
{"report":{"fcp":1348.6999998092651,"ttfb":256,"pageVisibility":"visible","entityId":52838,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"7054bbb3-8eac-4581-ae88-c557bef1779c","navigationType":0,"readyForUser":1441.1999998092651,"redirectCount":0,"resourceLoadedEnd":1567.6999998092651,"resourceLoadedStart":262.8999996185303,"resourceTiming":[{"duration":520.4000005722046,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":262.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":262.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":783.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":520.3999996185303,"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":263.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":263.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":783.5999994277954,"responseStart":0,"secureConnectionStart":0},{"duration":531.1999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":263.3999996185303,"connectEnd":263.3999996185303,"connectStart":263.3999996185303,"domainLookupEnd":263.3999996185303,"domainLookupStart":263.3999996185303,"fetchStart":263.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":263.3999996185303,"responseEnd":794.5999994277954,"responseStart":794.5999994277954,"secureConnectionStart":263.3999996185303},{"duration":631.8000001907349,"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":263.5999994277954,"connectEnd":263.5999994277954,"connectStart":263.5999994277954,"domainLookupEnd":263.5999994277954,"domainLookupStart":263.5999994277954,"fetchStart":263.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":263.5999994277954,"responseEnd":895.3999996185303,"responseStart":895.3999996185303,"secureConnectionStart":263.5999994277954},{"duration":636,"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":263.80000019073486,"connectEnd":263.80000019073486,"connectStart":263.80000019073486,"domainLookupEnd":263.80000019073486,"domainLookupStart":263.80000019073486,"fetchStart":263.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":263.80000019073486,"responseEnd":899.8000001907349,"responseStart":899.8000001907349,"secureConnectionStart":263.80000019073486},{"duration":636.1999998092651,"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":264,"connectEnd":264,"connectStart":264,"domainLookupEnd":264,"domainLookupStart":264,"fetchStart":264,"redirectEnd":0,"redirectStart":0,"requestStart":264,"responseEnd":900.1999998092651,"responseStart":900.1999998092651,"secureConnectionStart":264},{"duration":636.8000001907349,"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":264.19999980926514,"connectEnd":264.19999980926514,"connectStart":264.19999980926514,"domainLookupEnd":264.19999980926514,"domainLookupStart":264.19999980926514,"fetchStart":264.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":264.19999980926514,"responseEnd":901,"responseStart":901,"secureConnectionStart":264.19999980926514},{"duration":722.6999998092651,"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":264.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":264.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":987.0999994277954,"responseStart":0,"secureConnectionStart":0},{"duration":636.9000005722046,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":264.5999994277954,"connectEnd":264.5999994277954,"connectStart":264.5999994277954,"domainLookupEnd":264.5999994277954,"domainLookupStart":264.5999994277954,"fetchStart":264.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":264.5999994277954,"responseEnd":901.5,"responseStart":901.5,"secureConnectionStart":264.5999994277954},{"duration":722.5,"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":264.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":264.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":987.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":637.6999998092651,"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":264.8999996185303,"connectEnd":264.8999996185303,"connectStart":264.8999996185303,"domainLookupEnd":264.8999996185303,"domainLookupStart":264.8999996185303,"fetchStart":264.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":264.8999996185303,"responseEnd":902.5999994277954,"responseStart":902.5999994277954,"secureConnectionStart":264.8999996185303},{"duration":839.0999994277954,"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":266.5,"connectEnd":266.5,"connectStart":266.5,"domainLookupEnd":266.5,"domainLookupStart":266.5,"fetchStart":266.5,"redirectEnd":0,"redirectStart":0,"requestStart":266.5,"responseEnd":1105.5999994277954,"responseStart":1105.5999994277954,"secureConnectionStart":266.5},{"duration":1299.8000001907349,"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":266.5999994277954,"connectEnd":266.5999994277954,"connectStart":266.5999994277954,"domainLookupEnd":266.5999994277954,"domainLookupStart":266.5999994277954,"fetchStart":266.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":266.5999994277954,"responseEnd":1566.3999996185303,"responseStart":1566.3999996185303,"secureConnectionStart":266.5999994277954},{"duration":106.39999961853027,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":999.6999998092651,"connectEnd":999.6999998092651,"connectStart":999.6999998092651,"domainLookupEnd":999.6999998092651,"domainLookupStart":999.6999998092651,"fetchStart":999.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":999.6999998092651,"responseEnd":1106.0999994277954,"responseStart":1106.0999994277954,"secureConnectionStart":999.6999998092651},{"duration":283.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&slack-enabled=true&whisper-enabled=true","startTime":1284,"connectEnd":1284,"connectStart":1284,"domainLookupEnd":1284,"domainLookupStart":1284,"fetchStart":1284,"redirectEnd":0,"redirectStart":0,"requestStart":1284,"responseEnd":1567.6999998092651,"responseStart":1567.6999998092651,"secureConnectionStart":1284}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":92,"responseStart":256,"responseEnd":260,"domLoading":261,"domInteractive":1655,"domContentLoadedEventStart":1655,"domContentLoadedEventEnd":1700,"domComplete":2517,"loadEventStart":2517,"loadEventEnd":2517,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1626.8999996185303},{"name":"bigPipe.sidebar-id.end","time":1627.8000001907349},{"name":"bigPipe.activity-panel-pipe-id.start","time":1628},{"name":"bigPipe.activity-panel-pipe-id.end","time":1630.5999994277954},{"name":"activityTabFullyLoaded","time":1707}],"measures":[],"correlationId":"a7ef5d0a193d49","effectiveType":"4g","downlink":9.4,"rtt":0,"serverDuration":98,"dbReadsTimeInMs":13,"dbConnsTimeInMs":23,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}