Skip to content

Hard delete fails on MySQL with 'Illegal mix of collations for operation UNION' #38449

Closed

Description

@yan-3005

Affected module

Backend

Describe the bug

On MySQL, a hard delete of a taggable entity (test case, database service, domain, …) fails with HTTP 500:

java.sql.SQLException: Illegal mix of collations for operation 'UNION'
[statement:"/* TagUsageDAO.listEntityFqnHashes */ SELECT probe.hash FROM ((SELECT fqnHash AS hash FROM ...) UNION ALL ...) probe"]

FqnKeyedRowCleanup (added in #38126) probes every taggable entity table in one UNION ALL. MySQL rejects a UNION whose columns have different collations, and the hash columns do not share one:

  • most are ascii_bin
  • newer tables (ai_application_entity, task_entity, …) are utf8mb4_0900_ai_ci
  • query_entity.fqnHash (renamed in 1.2.0 with no collation) takes the server default

To Reproduce

  1. Run OpenMetadata on MySQL with --collation-server=utf8mb4_unicode_ci (any default other than utf8mb4_0900_ai_ci).
  2. Hard delete a test case: DELETE /api/v1/dataQuality/testCases/{id}?hardDelete=true&recursive=true.
  3. The request returns 500 with the error above.

Expected behavior

The hard delete succeeds whatever the server's default collation.

Version

Activity

  1. added
    bug
    on Nov 23, 2026
  2. moved this to In Progress 🏗️ in Shippingon Nov 23, 2026
  3. moved this from In Progress 🏗️ to Done ✅ in Shippingon Nov 23, 2026
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

    bug

    Type

    No type

    Projects

    • Status
      Done ✅
    • Status
      Done ✅

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions