[MDEV-32192] @@character_set_collations to resolve IMPLICIT collation on JOINs Created: 2023-09-18 Updated: 2023-09-22 Resolved: 2023-09-18 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Character Sets |
| Fix Version/s: | N/A |
| Type: | Task | Priority: | Critical |
| Reporter: | Daniel Black | Assignee: | Alexander Barkov |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
If character_set_collations is for resolving implicit collation types then in can be used in a JOIN too.
Last case shouldn't be an error as the resolution mechanism is possible. recent documentation addition by greenman indicates its use "in all cases". |
| Comments |
| Comment by Alexander Barkov [ 2023-09-18 ] | ||||||
|
You mix two different phenomena. Implicit collation assignment during CREATE TABLEA column collation gets assigned at CREATE TABLE time. After CREATE TABLE happened, it does not matter how the column was created: with or without COLLATE. IMPLICIT collation derivation when mixing expressionsEvery 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. Why this MDEV was closed as Won't doThe 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. |