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.
{"report":{"fcp":1148.1000000238419,"ttfb":158.29999995231628,"pageVisibility":"visible","entityId":49036,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"1bbcb756-34ab-43c4-bacb-c7b422270395","navigationType":0,"readyForUser":1210.6000000238419,"redirectCount":0,"resourceLoadedEnd":1603,"resourceLoadedStart":169.60000002384186,"resourceTiming":[{"duration":527.2999999523163,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":169.60000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":169.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":696.8999999761581,"responseStart":0,"secureConnectionStart":0},{"duration":527,"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":170,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":170,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":697,"responseStart":0,"secureConnectionStart":0},{"duration":535.8000000715256,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":170.19999992847443,"connectEnd":170.19999992847443,"connectStart":170.19999992847443,"domainLookupEnd":170.19999992847443,"domainLookupStart":170.19999992847443,"fetchStart":170.19999992847443,"redirectEnd":0,"redirectStart":0,"requestStart":170.19999992847443,"responseEnd":706,"responseStart":706,"secureConnectionStart":170.19999992847443},{"duration":559.7999999523163,"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":171,"connectEnd":171,"connectStart":171,"domainLookupEnd":171,"domainLookupStart":171,"fetchStart":171,"redirectEnd":0,"redirectStart":0,"requestStart":171,"responseEnd":730.7999999523163,"responseStart":730.7999999523163,"secureConnectionStart":171},{"duration":563.9000000953674,"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":171.19999992847443,"connectEnd":171.19999992847443,"connectStart":171.19999992847443,"domainLookupEnd":171.19999992847443,"domainLookupStart":171.19999992847443,"fetchStart":171.19999992847443,"redirectEnd":0,"redirectStart":0,"requestStart":171.19999992847443,"responseEnd":735.1000000238419,"responseStart":735.1000000238419,"secureConnectionStart":171.19999992847443},{"duration":564.2000000476837,"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":171.29999995231628,"connectEnd":171.29999995231628,"connectStart":171.29999995231628,"domainLookupEnd":171.29999995231628,"domainLookupStart":171.29999995231628,"fetchStart":171.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":171.29999995231628,"responseEnd":735.5,"responseStart":735.5,"secureConnectionStart":171.29999995231628},{"duration":564.7000000476837,"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":171.29999995231628,"connectEnd":171.29999995231628,"connectStart":171.29999995231628,"domainLookupEnd":171.29999995231628,"domainLookupStart":171.29999995231628,"fetchStart":171.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":171.29999995231628,"responseEnd":736,"responseStart":736,"secureConnectionStart":171.29999995231628},{"duration":565.1999999284744,"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":171.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":171.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":736.6999999284744,"responseStart":0,"secureConnectionStart":0},{"duration":565,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":171.5,"connectEnd":171.5,"connectStart":171.5,"domainLookupEnd":171.5,"domainLookupStart":171.5,"fetchStart":171.5,"redirectEnd":0,"redirectStart":0,"requestStart":171.5,"responseEnd":736.5,"responseStart":736.5,"secureConnectionStart":171.5},{"duration":565.3000000715256,"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":171.69999992847443,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":171.69999992847443,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":737,"responseStart":0,"secureConnectionStart":0},{"duration":565.2000000476837,"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":171.79999995231628,"connectEnd":171.79999995231628,"connectStart":171.79999995231628,"domainLookupEnd":171.79999995231628,"domainLookupStart":171.79999995231628,"fetchStart":171.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":171.79999995231628,"responseEnd":737,"responseStart":737,"secureConnectionStart":171.79999995231628},{"duration":935.7000000476837,"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":172.39999997615814,"connectEnd":172.39999997615814,"connectStart":172.39999997615814,"domainLookupEnd":172.39999997615814,"domainLookupStart":172.39999997615814,"fetchStart":172.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":172.39999997615814,"responseEnd":1108.1000000238419,"responseStart":1108.1000000238419,"secureConnectionStart":172.39999997615814},{"duration":1430.6000000238419,"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":172.39999997615814,"connectEnd":172.39999997615814,"connectStart":172.39999997615814,"domainLookupEnd":172.39999997615814,"domainLookupStart":172.39999997615814,"fetchStart":172.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":172.39999997615814,"responseEnd":1603,"responseStart":1603,"secureConnectionStart":172.39999997615814},{"duration":621.1000000238419,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":944.2999999523163,"connectEnd":944.2999999523163,"connectStart":944.2999999523163,"domainLookupEnd":944.2999999523163,"domainLookupStart":944.2999999523163,"fetchStart":944.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":944.2999999523163,"responseEnd":1565.3999999761581,"responseStart":1565.3999999761581,"secureConnectionStart":944.2999999523163},{"duration":510,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1124.7999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1124.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1634.7999999523163,"responseStart":0,"secureConnectionStart":0}],"fetchStart":1,"domainLookupStart":1,"domainLookupEnd":1,"connectStart":1,"connectEnd":1,"requestStart":4,"responseStart":159,"responseEnd":169,"domLoading":164,"domInteractive":1624,"domContentLoadedEventStart":1624,"domContentLoadedEventEnd":1660,"domComplete":2302,"loadEventStart":2302,"loadEventEnd":2304,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1605.5},{"name":"bigPipe.sidebar-id.end","time":1606.2999999523163},{"name":"bigPipe.activity-panel-pipe-id.start","time":1606.5},{"name":"bigPipe.activity-panel-pipe-id.end","time":1609},{"name":"activityTabFullyLoaded","time":1703.1999999284744}],"measures":[],"correlationId":"6faaacbd9f04b","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":84,"dbReadsTimeInMs":10,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}