You mix two different phenomena.
1. Implicit collation assignment during CREATE TABLE. Here the word "implicit" is used in its usual English meaning: take the collaton automatically from some defaults.
2. IMPLICIT collation derivation of an expression. This derivation takes effect when mixing two or more expressions for comparison or for result in CASE-alike expressions and in UNION. Here the word "IMPLICIT" means a special term from the SQL Standard.
Implicit collation assignment during CREATE TABLE
A column collation gets assigned at CREATE TABLE time.
1. If there is a COLLATE clause in the column definition, the the collation is taken from that COLLATE clause
2. If there is CHARACTER SET without COLLATE, the collation is implicitly chosen as the default collation of the specified character set. In this case @@character_set_collations is used.
3. If there are no CHARACTER SET / COLLATE clauses, the collation is implicitly taken from the higher level defaults.
After CREATE TABLE happened, it does not matter how the column was created: with or without COLLATE.
IMPLICIT collation derivation when mixing expressions
Every expression of a string data type has a collation precedence level, which determines which side wins when mixing expressions of different collations:
for comparison
for result, such as CASE-alike expressions, UNION
The SQL standard calls this precedence level as collation derivation.
MariaDB implements the following collation derivation levels (some of them are standard, some of them are MariaDB extensions):
IGNORABLE - NULL literal (the weakest)
NUMERIC - when a number or a datetime acts in string context
COERCIBLE - a string literal
SYSCONST - functions DATABASE(), USER()
IMPLICIT - table column, CAST( AS CHAR)
NONE - a concatenation of two expressions of different collations
EXPLICIT - an explicit COLLATE clause (the strongest)
You can see these collation derivation levels in "Illegal mix" error messages.
A table column has always IMPLICIT collation derivation.
No matter how it was created in CREATE TABLE (without or with COLLATE).
Why this MDEV was closed as Won't do
The new variable @@character_set_collations is intended to change the default collation when a column specified in CREATE TABLE has the CHARACTER SET clause but does not have the COLLATE clause:
CREATETABLE t1
(
-- This had been latin1_swedish_ci for years - the hard coded default
-- Now it honors @@character_set_collations - a soft default
c1 VARCHAR(32) CHARACTERSET latin1
);
The new variable is not intended to resolve illegal mix of collations.
In your example you have two columns of different collations. The right way to resolve this conflict is to use an explicit COLLATE clause.
Alexander Barkov
added a comment - - edited You mix two different phenomena.
1. Implicit collation assignment during CREATE TABLE. Here the word "implicit" is used in its usual English meaning: take the collaton automatically from some defaults.
2. IMPLICIT collation derivation of an expression. This derivation takes effect when mixing two or more expressions for comparison or for result in CASE-alike expressions and in UNION. Here the word "IMPLICIT" means a special term from the SQL Standard.
Implicit collation assignment during CREATE TABLE
A column collation gets assigned at CREATE TABLE time.
1. If there is a COLLATE clause in the column definition, the the collation is taken from that COLLATE clause
2. If there is CHARACTER SET without COLLATE, the collation is implicitly chosen as the default collation of the specified character set. In this case @@character_set_collations is used.
3. If there are no CHARACTER SET / COLLATE clauses, the collation is implicitly taken from the higher level defaults.
After CREATE TABLE happened, it does not matter how the column was created: with or without COLLATE.
IMPLICIT collation derivation when mixing expressions
Every expression of a string data type has a collation precedence level, which determines which side wins when mixing expressions of different collations:
for comparison
for result, such as CASE-alike expressions, UNION
The SQL standard calls this precedence level as collation derivation .
MariaDB implements the following collation derivation levels (some of them are standard, some of them are MariaDB extensions):
IGNORABLE - NULL literal (the weakest)
NUMERIC - when a number or a datetime acts in string context
COERCIBLE - a string literal
SYSCONST - functions DATABASE(), USER()
IMPLICIT - table column, CAST( AS CHAR)
NONE - a concatenation of two expressions of different collations
EXPLICIT - an explicit COLLATE clause (the strongest)
You can see these collation derivation levels in "Illegal mix" error messages.
A table column has always IMPLICIT collation derivation.
No matter how it was created in CREATE TABLE (without or with COLLATE).
Why this MDEV was closed as Won't do
The new variable @@character_set_collations is intended to change the default collation when a column specified in CREATE TABLE has the CHARACTER SET clause but does not have the COLLATE clause:
CREATE TABLE t1
(
-- This had been latin1_swedish_ci for years - the hard coded default
-- Now it honors @@character_set_collations - a soft default
c1 VARCHAR (32) CHARACTER SET latin1
);
The new variable is not intended to resolve illegal mix of collations.
In your example you have two columns of different collations. The right way to resolve this conflict is to use an explicit COLLATE clause.
People
Alexander Barkov
Daniel Black
Votes:
0Vote for this issue
Watchers:
2Start watching this issue
Dates
Created:
Updated:
Resolved:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":1577.6999998092651,"ttfb":347.5,"pageVisibility":"visible","entityId":125096,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"3b5427d4-b74c-4582-9bf0-22066daf177c","navigationType":0,"readyForUser":1650.1999998092651,"redirectCount":0,"resourceLoadedEnd":1818.5999994277954,"resourceLoadedStart":352.79999923706055,"resourceTiming":[{"duration":719.6000003814697,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":352.79999923706055,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":352.79999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1072.3999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":719.7999992370605,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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":353,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":353,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1072.7999992370605,"responseStart":0,"secureConnectionStart":0},{"duration":774.1999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":353.19999980926514,"connectEnd":353.19999980926514,"connectStart":353.19999980926514,"domainLookupEnd":353.19999980926514,"domainLookupStart":353.19999980926514,"fetchStart":353.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":353.19999980926514,"responseEnd":1127.3999996185303,"responseStart":1127.3999996185303,"secureConnectionStart":353.19999980926514},{"duration":847,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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":353.3999996185303,"connectEnd":353.3999996185303,"connectStart":353.3999996185303,"domainLookupEnd":353.3999996185303,"domainLookupStart":353.3999996185303,"fetchStart":353.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":353.3999996185303,"responseEnd":1200.3999996185303,"responseStart":1200.3999996185303,"secureConnectionStart":353.3999996185303},{"duration":851,"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":353.5999994277954,"connectEnd":353.5999994277954,"connectStart":353.5999994277954,"domainLookupEnd":353.5999994277954,"domainLookupStart":353.5999994277954,"fetchStart":353.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":353.5999994277954,"responseEnd":1204.5999994277954,"responseStart":1204.5999994277954,"secureConnectionStart":353.5999994277954},{"duration":851.3000001907349,"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":353.79999923706055,"connectEnd":353.79999923706055,"connectStart":353.79999923706055,"domainLookupEnd":353.79999923706055,"domainLookupStart":353.79999923706055,"fetchStart":353.79999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":353.79999923706055,"responseEnd":1205.0999994277954,"responseStart":1205.0999994277954,"secureConnectionStart":353.79999923706055},{"duration":851.5,"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":354,"connectEnd":354,"connectStart":354,"domainLookupEnd":354,"domainLookupStart":354,"fetchStart":354,"redirectEnd":0,"redirectStart":0,"requestStart":354,"responseEnd":1205.5,"responseStart":1205.5,"secureConnectionStart":354},{"duration":914.1999998092651,"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":354.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":354.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1268.3999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":851.6000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":354.29999923706055,"connectEnd":354.29999923706055,"connectStart":354.29999923706055,"domainLookupEnd":354.29999923706055,"domainLookupStart":354.29999923706055,"fetchStart":354.29999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":354.29999923706055,"responseEnd":1205.8999996185303,"responseStart":1205.8999996185303,"secureConnectionStart":354.29999923706055},{"duration":914.0999994277954,"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":354.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":354.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1268.5999994277954,"responseStart":0,"secureConnectionStart":0},{"duration":851.9000005722046,"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":354.5999994277954,"connectEnd":354.5999994277954,"connectStart":354.5999994277954,"domainLookupEnd":354.5999994277954,"domainLookupStart":354.5999994277954,"fetchStart":354.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":354.5999994277954,"responseEnd":1206.5,"responseStart":1206.5,"secureConnectionStart":354.5999994277954},{"duration":1462.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":355.5,"connectEnd":355.5,"connectStart":355.5,"domainLookupEnd":355.5,"domainLookupStart":355.5,"fetchStart":355.5,"redirectEnd":0,"redirectStart":0,"requestStart":355.5,"responseEnd":1817.5999994277954,"responseStart":1817.5999994277954,"secureConnectionStart":355.5},{"duration":1463.0999994277954,"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":355.5,"connectEnd":355.5,"connectStart":355.5,"domainLookupEnd":355.5,"domainLookupStart":355.5,"fetchStart":355.5,"redirectEnd":0,"redirectStart":0,"requestStart":355.5,"responseEnd":1818.5999994277954,"responseStart":1818.5999994277954,"secureConnectionStart":355.5},{"duration":337.30000019073486,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1280.2999992370605,"connectEnd":1280.2999992370605,"connectStart":1280.2999992370605,"domainLookupEnd":1280.2999992370605,"domainLookupStart":1280.2999992370605,"fetchStart":1280.2999992370605,"redirectEnd":0,"redirectStart":0,"requestStart":1280.2999992370605,"responseEnd":1617.5999994277954,"responseStart":1617.5999994277954,"secureConnectionStart":1280.2999992370605},{"duration":309.8999996185303,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1571.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1571.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1881.2999992370605,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":189,"responseStart":348,"responseEnd":350,"domLoading":351,"domInteractive":1843,"domContentLoadedEventStart":1843,"domContentLoadedEventEnd":1881,"domComplete":2428,"loadEventStart":2429,"loadEventEnd":2429,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1821.5},{"name":"bigPipe.sidebar-id.end","time":1822.2999992370605},{"name":"bigPipe.activity-panel-pipe-id.start","time":1822.3999996185303},{"name":"bigPipe.activity-panel-pipe-id.end","time":1823.6999998092651},{"name":"activityTabFullyLoaded","time":1893.6999998092651}],"measures":[],"correlationId":"40b619bd1f31d9","effectiveType":"4g","downlink":9.7,"rtt":0,"serverDuration":97,"dbReadsTimeInMs":10,"dbConnsTimeInMs":17,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
You mix two different phenomena.
1. Implicit collation assignment during CREATE TABLE. Here the word "implicit" is used in its usual English meaning: take the collaton automatically from some defaults.
2. IMPLICIT collation derivation of an expression. This derivation takes effect when mixing two or more expressions for comparison or for result in CASE-alike expressions and in UNION. Here the word "IMPLICIT" means a special term from the SQL Standard.
Implicit collation assignment during CREATE TABLE
A column collation gets assigned at CREATE TABLE time.
1. If there is a COLLATE clause in the column definition, the the collation is taken from that COLLATE clause
2. If there is CHARACTER SET without COLLATE, the collation is implicitly chosen as the default collation of the specified character set. In this case @@character_set_collations is used.
3. If there are no CHARACTER SET / COLLATE clauses, the collation is implicitly taken from the higher level defaults.
After CREATE TABLE happened, it does not matter how the column was created: with or without COLLATE.
IMPLICIT collation derivation when mixing expressions
Every expression of a string data type has a collation precedence level, which determines which side wins when mixing expressions of different collations:
The SQL standard calls this precedence level as collation derivation.
MariaDB implements the following collation derivation levels (some of them are standard, some of them are MariaDB extensions):
You can see these collation derivation levels in "Illegal mix" error messages.
A table column has always IMPLICIT collation derivation.
No matter how it was created in CREATE TABLE (without or with COLLATE).
Why this MDEV was closed as Won't do
The new variable @@character_set_collations is intended to change the default collation when a column specified in CREATE TABLE has the CHARACTER SET clause but does not have the COLLATE clause:
(
);
The new variable is not intended to resolve illegal mix of collations.
In your example you have two columns of different collations. The right way to resolve this conflict is to use an explicit COLLATE clause.