Repository navigation
[2.1] Fix hard delete failing on MySQL with 'Illegal mix of collations' in FQN cleanup (#38443) - #38444
Merged
Conversation
The hard-delete cleanup from #38126 probes every taggable entity table in one UNION ALL. MySQL rejects a UNION whose columns have different collations, and an install's hash columns do not share one: most are ascii_bin, the newer tables declare utf8mb4_0900_ai_ci, and query_entity.fqnHash (renamed in 1.2.0 without a collation) takes the server default. On a server whose default is not utf8mb4_0900_ai_ci, every hard delete of a taggable entity fails with "Illegal mix of collations for operation 'UNION'". On MySQL each probe now selects CONVERT(hash USING utf8mb4) COLLATE utf8mb4_bin. The WHERE clause still reads the bare column, so the lookup keeps its index. No schema change. (cherry picked from commit 4f9ccf8)
Contributor
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
The SQL-string test cannot catch the collation error. This one starts MySQL with utf8mb4_unicode_ci as the server default and three tables on the collations an install mixes (ascii_bin, utf8mb4_0900_ai_ci, server default). The bare-column union fails with 'Illegal mix of collations'; the namesake and nested probes return the hash from every table. (cherry picked from commit 5316487)
manerow
approved these changes
Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #38449
Backport of #38443 to
2.1.2.1 has the same
FqnKeyedRowCleanupUNION probe (from #38126 through #38229), so a hard delete on a MySQL server whose default collation is notutf8mb4_0900_ai_cifails withIllegal mix of collations for operation 'UNION'. On MySQL each probe now selectsCONVERT(<hash> USING utf8mb4) COLLATE utf8mb4_bin; theWHEREclause keeps the bare column and its index. Postgres unchanged, no schema change.Clean cherry-pick.
FqnKeyedRowCleanupTeston this branch: Tests run: 14, Failures: 0, Errors: 0.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no new actionable issue was found.Summary
Fixes MySQL hard-delete probes by selecting hashes with a shared collation. PostgreSQL SQL and lookup conditions stay unchanged.
Reviews (6) · Last reviewed commit: "Run the FQN-cleanup probes on a real MyS..." · Reviewed by Greptile