Skip to content

Collation_connection always set to utf8mb4_0900_ai_ci on a database created with utf8mb4_0900_as_ci #2013

@TheSmallGrove

Description

@TheSmallGrove

Hallo everyone,

I've an issue with the collation utf8mb4_0900_as_ci (Accent Sensitive) I used for creating everything in a database. Once I connect to the database (I use EFCore 9.0 with POMELO), I get an error when I try to use NULLIF with simple string.

NULLIF(s.Code, '')
ERROR: Illegal mix of collations (utf8mb4_0900_ai_ci,COERCIBLE) and (utf8mb4_0900_as_ci,COERCIBLE)

I need to explicitly cast the string to have it work
NULLIF(s.Code, ('' COLLATE utf8mb4_0900_as_ci))

Deeply investigating this issue I found that the variable 'collation_connection' is always set to 'utf8mb4_0900_ai_ci' (Accent Insensitive) also if I use

SET NAMES 'utf8mb4' COLLATE 'utf8mb4_0900_as_ci';

or also

SET SESSION collation_connection = 'utf8mb4_0900_as_ci';

I also tryied to put there SETs in the "init_connect" variable without any change.

Do anyone faced the same issue? What I'm doing wrong?

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions