Skip to content

No support for default collation (utf8mb4_uca1400_ai_ci) in MariaDB #4222

Open

Description

@wouthoekstra

Version

1.30.0

What happened?

When I run sqlc generate in my project, I get this output:

# package sqlc
sql/schema.sql:1:1: [ddl:1273]Unknown collation: 'utf8mb4_uca1400_ai_ci'"

I am unsure if this considered is a bug or a feature, but according to the mariadb documentation utf8mb4_uca1400_ai_ci is now the default collation:
https://mariadb.com/docs/server/reference/data-types/string-data-types/character-sets/character-set-and-collation-overview

I am aware that the project does not specifically mention support for MariaDB. Since the project is so close to MySQL I hope this still is considered as a fixable bug.

For reproduction purposes, this is one of my tables (simplified a bit) in my schema that triggers this error:

CREATE TABLE `user` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `created_at` datetime NOT NULL DEFAULT current_timestamp(),
  `updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(),
  `username` varchar(255) NOT NULL DEFAULT '',
  `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_username_unique` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci;

Relevant log output

Database schema

SQL queries

Configuration

Playground URL

No response

What operating system are you using?

macOS

What database engines are you using?

No response

What type of code are you generating?

No response

Activity

  1. mujib77 commented on May 11, 2026

    @mujib77

    I investigated this issue on the current main branch and was able to consistently reproduce it using a minimal MariaDB schema with:

    DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci

    Running:

    sqlc generate

    fails with:

    [ddl:1273]Unknown collation: 'utf8mb4_uca1400_ai_ci'
    

    I traced the parsing flow into internal/engine/dolphin/parse.go, specifically the call to:

    p.pingcap.Parse(...)

    I attempted a temporary normalization workaround by replacing:

    utf8mb4_uca1400_ai_ci
    

    with:

    utf8mb4_general_ci
    

    before parsing.

    However:

    • the original reproduction issue still occurred
    • and several parser-related tests started failing (TestSplit, etc.)

    So it seems the unsupported collation handling likely occurs deeper in the parser / DDL validation layer rather than only at the top-level parse entrypoint.

    Leaving my investigation notes here in case they help future work on proper MariaDB collation support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions