Type:
Bug
Priority:
Major
Resolution:
Fixed
Affects Version/s:
5.1.67 , 5.2.14 , 5.3.12 , 5.5(EOL) , 10.0(EOL) , 10.1(EOL)
This script:
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET cp1251 COLLATE cp1251_ukrainian_ci);
INSERT INTO t1 VALUES (' 1'),('`1');
SELECT * FROM t1 WHERE a IN (1,2,3);
returns one row:
+------+
| a |
+------+
| 1 |
+------+
Now if I make the condition even stroger:
SELECT * FROM t1 WHERE a IN (1,2,3) AND a=' 1';
It erroneously returns two rows:
+------+
| a |
+------+
| 1 |
| `1 |
+------+
It should return one row.
The problem happens in equal fields propagation in this code:
if (!item || !has_compatible_context(item))
item= this;
Item_func_in does not set cmp_type of args[0] , so has_compatible_context() passes and the field gets erroneously replaced to the string constant which makes Item_func_in::val_int() always evaluate to TRUE.
blocks
MDEV-8728
Fix a number of problems in equal field and equal expression propagation
Closed
Transition
Time In Source Status
Execution Times
Open
Closed
1d 11h 46m
1
{"report":{"fcp":2109.9000005722046,"ttfb":348.30000019073486,"pageVisibility":"visible","entityId":52831,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"c121e56e-01b9-4ef7-b5a6-1182da59dd0b","navigationType":0,"readyForUser":2128.300000190735,"redirectCount":0,"resourceLoadedEnd":1525.5,"resourceLoadedStart":360.9000005722046,"resourceTiming":[{"duration":402.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":360.9000005722046,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":360.9000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":763.4000005722046,"responseStart":0,"secureConnectionStart":0},{"duration":402.69999980926514,"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":361.1000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":361.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":763.8000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":808.1000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":361.30000019073486,"connectEnd":361.30000019073486,"connectStart":361.30000019073486,"domainLookupEnd":361.30000019073486,"domainLookupStart":361.30000019073486,"fetchStart":361.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":764.8000001907349,"responseEnd":1169.4000005722046,"responseStart":795.5,"secureConnectionStart":361.30000019073486},{"duration":1093.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":361.5,"connectEnd":361.5,"connectStart":361.5,"domainLookupEnd":361.5,"domainLookupStart":361.5,"fetchStart":361.5,"redirectEnd":0,"redirectStart":0,"requestStart":766.7000007629395,"responseEnd":1455.3000001907349,"responseStart":800.2000007629395,"secureConnectionStart":361.5},{"duration":440.29999923706055,"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":361.70000076293945,"connectEnd":361.70000076293945,"connectStart":361.70000076293945,"domainLookupEnd":361.70000076293945,"domainLookupStart":361.70000076293945,"fetchStart":361.70000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":767,"responseEnd":802,"responseStart":800.7000007629395,"secureConnectionStart":361.70000076293945},{"duration":442.30000019073486,"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":361.80000019073486,"connectEnd":361.80000019073486,"connectStart":361.80000019073486,"domainLookupEnd":361.80000019073486,"domainLookupStart":361.80000019073486,"fetchStart":361.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":767.1000003814697,"responseEnd":804.1000003814697,"responseStart":802.1000003814697,"secureConnectionStart":361.80000019073486},{"duration":442.19999980926514,"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":362.1000003814697,"connectEnd":362.1000003814697,"connectStart":362.1000003814697,"domainLookupEnd":362.1000003814697,"domainLookupStart":362.1000003814697,"fetchStart":362.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":767.3000001907349,"responseEnd":804.3000001907349,"responseStart":802.8000001907349,"secureConnectionStart":362.1000003814697},{"duration":401.6000003814697,"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":362.30000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":362.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":763.9000005722046,"responseStart":0,"secureConnectionStart":0},{"duration":444.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":362.4000005722046,"connectEnd":362.4000005722046,"connectStart":362.4000005722046,"domainLookupEnd":362.4000005722046,"domainLookupStart":362.4000005722046,"fetchStart":362.4000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":768,"responseEnd":806.7000007629395,"responseStart":804.7000007629395,"secureConnectionStart":362.4000005722046},{"duration":404.69999980926514,"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":362.6000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":362.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":767.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":446.69999980926514,"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":362.70000076293945,"connectEnd":362.70000076293945,"connectStart":362.70000076293945,"domainLookupEnd":362.70000076293945,"domainLookupStart":362.70000076293945,"fetchStart":362.70000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":768.8000001907349,"responseEnd":809.4000005722046,"responseStart":805.3000001907349,"secureConnectionStart":362.70000076293945},{"duration":1160.5999994277954,"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":363.70000076293945,"connectEnd":363.70000076293945,"connectStart":363.70000076293945,"domainLookupEnd":363.70000076293945,"domainLookupStart":363.70000076293945,"fetchStart":363.70000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":1069.4000005722046,"responseEnd":1524.3000001907349,"responseStart":1460.3000001907349,"secureConnectionStart":363.70000076293945},{"duration":1161.6999998092651,"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":363.80000019073486,"connectEnd":363.80000019073486,"connectStart":363.80000019073486,"domainLookupEnd":363.80000019073486,"domainLookupStart":363.80000019073486,"fetchStart":363.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":1198.3000001907349,"responseEnd":1525.5,"responseStart":1520.5,"secureConnectionStart":363.80000019073486},{"duration":455.0999994277954,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1452.4000005722046,"connectEnd":1452.4000005722046,"connectStart":1452.4000005722046,"domainLookupEnd":1452.4000005722046,"domainLookupStart":1452.4000005722046,"fetchStart":1452.4000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":1790.9000005722046,"responseEnd":1907.5,"responseStart":1906.2000007629395,"secureConnectionStart":1452.4000005722046}],"fetchStart":0,"domainLookupStart":136,"domainLookupEnd":144,"connectStart":144,"connectEnd":163,"secureConnectionStart":152,"requestStart":163,"responseStart":348,"responseEnd":356,"domLoading":356,"domInteractive":2227,"domContentLoadedEventStart":2227,"domContentLoadedEventEnd":2286,"domComplete":3893,"loadEventStart":3893,"loadEventEnd":3894,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":2174.2000007629395},{"name":"bigPipe.sidebar-id.end","time":2175},{"name":"bigPipe.activity-panel-pipe-id.start","time":2175.1000003814697},{"name":"bigPipe.activity-panel-pipe-id.end","time":2176},{"name":"activityTabFullyLoaded","time":2300.9000005722046}],"measures":[],"correlationId":"8ce1a22594b3c9","effectiveType":"4g","downlink":9.4,"rtt":0,"serverDuration":95,"dbReadsTimeInMs":13,"dbConnsTimeInMs":22,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}