I currently write some queries during migration to ColumnStore from another Database and stumbled upon a probable bug concerning collation.
We have columns where we use WHERE clauses where the matching has to be case sensitive. Therefore I created the database with a binary collation as default settings.
When filtering with a WHERE clause using the LIKE operator, the collation settings seem to be used. When using with IN this seem to be not the case.
Expected result: IN operator should also be case sensitive when set in the database settings.
MariaDB [dac]> CREATE DATABASE test CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
|
Query OK, 1 row affected (0.028 sec)
|
|
MariaDB [dac]> USE test;
|
Database changed
|
MariaDB [test]> DROP TABLE IF EXISTS collation_test;
|
Query OK, 0 rows affected, 1 warning (0.325 sec)
|
|
MariaDB [test]>
|
MariaDB [test]> CREATE TABLE collation_test (
|
-> LETTERS TEXT NULL
|
-> )
|
-> ENGINE=ColumnStore;
|
Query OK, 0 rows affected (0.878 sec)
|
|
MariaDB [test]>
|
MariaDB [test]> INSERT INTO collation_test (LETTERS) VALUES ('a'), ('A'), ('b'), ('B');
|
Query OK, 4 rows affected (0.827 sec)
|
Records: 4 Duplicates: 0 Warnings: 0
|
|
MariaDB [test]>
|
MariaDB [test]> SELECT * FROM collation_test;
|
+---------+
|
| LETTERS |
|
+---------+
|
| a |
|
| A |
|
| b |
|
| B |
|
+---------+
|
4 rows in set (0.396 sec)
|
|
MariaDB [test]>
|
MariaDB [test]> SELECT * FROM collation_test WHERE LETTERS LIKE 'a';
|
+---------+
|
| LETTERS |
|
+---------+
|
| a |
|
+---------+
|
1 row in set (0.029 sec)
|
|
MariaDB [test]> SELECT * FROM collation_test WHERE LETTERS IN ('a');
|
+---------+
|
| LETTERS |
|
+---------+
|
| a |
|
| A |
|
+---------+
|
2 rows in set (0.047 sec)
|
|
MariaDB [test]>
|
Setting the collation explicitly does not help either
MariaDB [test]> SELECT * FROM collation_test WHERE LETTERS IN ('a' COLLATE utf8mb4_bin);
|
ERROR 1253 (42000): COLLATION 'utf8mb4_bin' is not valid for CHARACTER SET 'latin1'
|
The setting is though set to utf8mb4_bin. (checked via SHOW TABLE STATUS LIKE 'collation_test'.
{"report":{"fcp":1231.3999996185303,"ttfb":417,"pageVisibility":"visible","entityId":104003,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"51480470-e142-44b3-8cdb-d6fd3db8c1b7","navigationType":0,"readyForUser":1366.3999996185303,"redirectCount":0,"resourceLoadedEnd":1554.7999997138977,"resourceLoadedStart":422.5,"resourceTiming":[{"duration":161.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":422.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":422.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":584,"responseStart":0,"secureConnectionStart":0},{"duration":162.5,"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":422.7999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":422.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":585.2999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":218.39999961853027,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":423,"connectEnd":423,"connectStart":423,"domainLookupEnd":423,"domainLookupStart":423,"fetchStart":423,"redirectEnd":0,"redirectStart":0,"requestStart":423,"responseEnd":641.3999996185303,"responseStart":641.3999996185303,"secureConnectionStart":423},{"duration":365.7999997138977,"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":423.09999990463257,"connectEnd":423.09999990463257,"connectStart":423.09999990463257,"domainLookupEnd":423.09999990463257,"domainLookupStart":423.09999990463257,"fetchStart":423.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":423.09999990463257,"responseEnd":788.8999996185303,"responseStart":788.8999996185303,"secureConnectionStart":423.09999990463257},{"duration":371.90000009536743,"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":423.3999996185303,"connectEnd":423.3999996185303,"connectStart":423.3999996185303,"domainLookupEnd":423.3999996185303,"domainLookupStart":423.3999996185303,"fetchStart":423.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":423.3999996185303,"responseEnd":795.2999997138977,"responseStart":795.2999997138977,"secureConnectionStart":423.3999996185303},{"duration":374.69999980926514,"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":423.59999990463257,"connectEnd":423.59999990463257,"connectStart":423.59999990463257,"domainLookupEnd":423.59999990463257,"domainLookupStart":423.59999990463257,"fetchStart":423.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":423.59999990463257,"responseEnd":798.2999997138977,"responseStart":798.2999997138977,"secureConnectionStart":423.59999990463257},{"duration":375.2000002861023,"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":423.7999997138977,"connectEnd":423.7999997138977,"connectStart":423.7999997138977,"domainLookupEnd":423.7999997138977,"domainLookupStart":423.7999997138977,"fetchStart":423.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":423.7999997138977,"responseEnd":799,"responseStart":799,"secureConnectionStart":423.7999997138977},{"duration":377.30000019073486,"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":423.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":423.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":801.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":376.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":424,"connectEnd":424,"connectStart":424,"domainLookupEnd":424,"domainLookupStart":424,"fetchStart":424,"redirectEnd":0,"redirectStart":0,"requestStart":424,"responseEnd":800.0999999046326,"responseStart":800.0999999046326,"secureConnectionStart":424},{"duration":376.90000009536743,"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":424.2999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":424.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":801.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":376.5,"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":424.2999997138977,"connectEnd":424.2999997138977,"connectStart":424.2999997138977,"domainLookupEnd":424.2999997138977,"domainLookupStart":424.2999997138977,"fetchStart":424.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":424.2999997138977,"responseEnd":800.7999997138977,"responseStart":800.7999997138977,"secureConnectionStart":424.2999997138977},{"duration":932.6000003814697,"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":429.8999996185303,"connectEnd":429.8999996185303,"connectStart":429.8999996185303,"domainLookupEnd":429.8999996185303,"domainLookupStart":429.8999996185303,"fetchStart":429.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":429.8999996185303,"responseEnd":1362.5,"responseStart":1362.5,"secureConnectionStart":429.8999996185303},{"duration":934,"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":430,"connectEnd":430,"connectStart":430,"domainLookupEnd":430,"domainLookupStart":430,"fetchStart":430,"redirectEnd":0,"redirectStart":0,"requestStart":430,"responseEnd":1364,"responseStart":1363.8999996185303,"secureConnectionStart":430},{"duration":538.5999999046326,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":807,"connectEnd":807,"connectStart":807,"domainLookupEnd":807,"domainLookupStart":807,"fetchStart":807,"redirectEnd":0,"redirectStart":0,"requestStart":807,"responseEnd":1345.5999999046326,"responseStart":1345.5999999046326,"secureConnectionStart":807},{"duration":291,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1214.7999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1214.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1505.7999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":120.59999990463257,"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":1434.1999998092651,"connectEnd":1434.1999998092651,"connectStart":1434.1999998092651,"domainLookupEnd":1434.1999998092651,"domainLookupStart":1434.1999998092651,"fetchStart":1434.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":1434.1999998092651,"responseEnd":1554.7999997138977,"responseStart":1554.7999997138977,"secureConnectionStart":1434.1999998092651}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":256,"responseStart":417,"responseEnd":422,"domLoading":420,"domInteractive":1567,"domContentLoadedEventStart":1567,"domContentLoadedEventEnd":1615,"domComplete":3074,"loadEventStart":3074,"loadEventEnd":3076,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1519.6999998092651},{"name":"bigPipe.sidebar-id.end","time":1520.3999996185303},{"name":"bigPipe.activity-panel-pipe-id.start","time":1520.5999999046326},{"name":"bigPipe.activity-panel-pipe-id.end","time":1523.1999998092651},{"name":"activityTabFullyLoaded","time":1623.5}],"measures":[],"correlationId":"a12947a900b6bb","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":92,"dbReadsTimeInMs":8,"dbConnsTimeInMs":15,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}