SET NAMES utf8 COLLATE utf8_german2_ci;
|
DROP TABLE IF EXISTS t1;
|
CREATE TABLE t1 (a CHAR(10) CHARACTER SET utf8);
|
INSERT INTO t1 VALUES ('ö'),('oe');
|
SELECT * FROM t1 WHERE a='oe' AND a='oe' COLLATE utf8_german2_ci;
|
SELECT * FROM t1 WHERE a='oe' COLLATE utf8_german2_ci AND a='oe';
|
The first SELECT query returns one row:
+------+
|
| a |
|
+------+
|
| oe |
|
+------+
|
The second SELECT query returns two rows:
+------+
|
| a |
|
+------+
|
| ö |
|
| oe |
|
+------+
|
The result for the second query is wrong.
Both SELECT queries should return the same result with one row.
The WHERE condition is logically the same in the two queries, the only different is the order of the AND operands.
EXPLAIN for the second query:
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='oe' COLLATE utf8_german2_ci AND a='oe';
|
SHOW WARNINGS;
|
returns:
+-------+------+-------------------------------------------------------------------------------+
|
| Level | Code | Message |
|
+-------+------+-------------------------------------------------------------------------------+
|
| Note | 1003 | select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 'oe') |
|
+-------+------+-------------------------------------------------------------------------------+
|
It seems the condition was simplified in a wrong way. It should not have been simplified because the two equality predicates use different collations.
Transition |
Time In Source Status |
Execution Times |
Open |
|
Closed |
|
58d 3h 39m
|
1
|
{"report":{"fcp":1354.199999988079,"ttfb":355.10000002384186,"pageVisibility":"visible","entityId":49036,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"80246267-a70a-4776-9597-4b1c4ad6a4a7","navigationType":0,"readyForUser":1443.8999999761581,"redirectCount":0,"resourceLoadedEnd":1607.8999999761581,"resourceLoadedStart":362.5,"resourceTiming":[{"duration":440.89999997615814,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":362.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":362.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":803.3999999761581,"responseStart":0,"secureConnectionStart":0},{"duration":443.80000001192093,"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":362.80000001192093,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":362.80000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":806.6000000238419,"responseStart":0,"secureConnectionStart":0},{"duration":601.1999999880791,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":363,"connectEnd":807.5,"connectStart":807.5,"domainLookupEnd":807.5,"domainLookupStart":807.5,"fetchStart":363,"redirectEnd":0,"redirectStart":0,"requestStart":809.3999999761581,"responseEnd":964.1999999880791,"responseStart":824,"secureConnectionStart":807.5},{"duration":711.1999999880791,"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":363.19999998807907,"connectEnd":363.19999998807907,"connectStart":363.19999998807907,"domainLookupEnd":363.19999998807907,"domainLookupStart":363.19999998807907,"fetchStart":363.19999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":810,"responseEnd":1074.3999999761581,"responseStart":829.5,"secureConnectionStart":363.19999998807907},{"duration":467.19999998807907,"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":363.5,"connectEnd":363.5,"connectStart":363.5,"domainLookupEnd":363.5,"domainLookupStart":363.5,"fetchStart":363.5,"redirectEnd":0,"redirectStart":0,"requestStart":810.1000000238419,"responseEnd":830.6999999880791,"responseStart":828.8000000119209,"secureConnectionStart":363.5},{"duration":472.0999999642372,"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":363.60000002384186,"connectEnd":363.60000002384186,"connectStart":363.60000002384186,"domainLookupEnd":363.60000002384186,"domainLookupStart":363.60000002384186,"fetchStart":363.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":810.3000000119209,"responseEnd":835.6999999880791,"responseStart":833.8000000119209,"secureConnectionStart":363.60000002384186},{"duration":472.39999997615814,"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":363.80000001192093,"connectEnd":363.80000001192093,"connectStart":363.80000001192093,"domainLookupEnd":363.80000001192093,"domainLookupStart":363.80000001192093,"fetchStart":363.80000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":810.8000000119209,"responseEnd":836.1999999880791,"responseStart":834.5,"secureConnectionStart":363.80000001192093},{"duration":445.80000001192093,"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":363.89999997615814,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":363.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":809.6999999880791,"responseStart":0,"secureConnectionStart":0},{"duration":477.19999998807907,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":364.19999998807907,"connectEnd":364.19999998807907,"connectStart":364.19999998807907,"domainLookupEnd":364.19999998807907,"domainLookupStart":364.19999998807907,"fetchStart":364.19999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":815.3999999761581,"responseEnd":841.3999999761581,"responseStart":838.8000000119209,"secureConnectionStart":364.19999998807907},{"duration":446.10000002384186,"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":364.39999997615814,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":364.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":810.5,"responseStart":0,"secureConnectionStart":0},{"duration":477.5999999642372,"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":364.60000002384186,"connectEnd":364.60000002384186,"connectStart":364.60000002384186,"domainLookupEnd":364.60000002384186,"domainLookupStart":364.60000002384186,"fetchStart":364.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":816.1999999880791,"responseEnd":842.1999999880791,"responseStart":840,"secureConnectionStart":364.60000002384186},{"duration":765.3999999761581,"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":370.5,"connectEnd":370.5,"connectStart":370.5,"domainLookupEnd":370.5,"domainLookupStart":370.5,"fetchStart":370.5,"redirectEnd":0,"redirectStart":0,"requestStart":1124.5,"responseEnd":1135.8999999761581,"responseStart":1135.300000011921,"secureConnectionStart":370.5},{"duration":1237.3999999761581,"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":370.5,"connectEnd":370.5,"connectStart":370.5,"domainLookupEnd":370.5,"domainLookupStart":370.5,"fetchStart":370.5,"redirectEnd":0,"redirectStart":0,"requestStart":1596.3999999761581,"responseEnd":1607.8999999761581,"responseStart":1607,"secureConnectionStart":370.5},{"duration":248.4000000357628,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1099.199999988079,"connectEnd":1099.199999988079,"connectStart":1099.199999988079,"domainLookupEnd":1099.199999988079,"domainLookupStart":1099.199999988079,"fetchStart":1099.199999988079,"redirectEnd":0,"redirectStart":0,"requestStart":1314.699999988079,"responseEnd":1347.6000000238419,"responseStart":1346.800000011921,"secureConnectionStart":1099.199999988079},{"duration":286.60000002384186,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1346.699999988079,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1346.699999988079,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1633.300000011921,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":188,"responseStart":355,"responseEnd":368,"domLoading":360,"domInteractive":1674,"domContentLoadedEventStart":1674,"domContentLoadedEventEnd":1716,"domComplete":2698,"loadEventStart":2698,"loadEventEnd":2698,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1634.3999999761581},{"name":"bigPipe.sidebar-id.end","time":1635.3999999761581},{"name":"bigPipe.activity-panel-pipe-id.start","time":1635.6000000238419},{"name":"bigPipe.activity-panel-pipe-id.end","time":1636.3999999761581},{"name":"activityTabFullyLoaded","time":1726.800000011921}],"measures":[],"correlationId":"f9a67afa7d2955","effectiveType":"4g","downlink":9.3,"rtt":0,"serverDuration":94,"dbReadsTimeInMs":15,"dbConnsTimeInMs":23,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}