Repository navigation
fix: reject a collation on a string set column unless it compares bytes, on 10.x (port of #483, #496) - #500
Merged
CaffeinatedCoder merged 3 commits intoOct 26, 2026
Conversation
…es (#483) PostgreSQL compares text[] elements with the column's collation, memory ordinally. Under a nondeterministic collation A equals a: on a case-insensitive StringSet column Contains("a") matched {A}, IsSubsetOf, Overlaps and == agreed with it, and ExecuteUpdate with Remove("a") stored {} where memory keeps {A}. Translating with COLLATE "C" was measured and rejected: the GIN index carries the column's collation, so a collated operand turns every indexed @> into a sequential scan, on an en_US column too (PostgreSQL 16 and 18). So a model-finalizing convention, added through IConventionSetPlugin, throws for a collation on a StringSet or StringSet<T> column other than C, POSIX, ucs_basic, pg_c_utf8 and default, which compare bytes; a name doesn't say whether a collation is deterministic. ValueSetSqlGuard refuses EF.Functions.Collate over a string set the same way. A JSON document holds the set's literal and is not checked. Found-By: CA Defect-Class: SQL Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 98e51a1)
…migration and changelog (#483) The model-build rejection and the Collate refusal in the previous commit, in the EF guide's value set section, the v10.x migration list and its section, the Breaking lines of 11.0.0-preview.1, claim E86, and the live test that a column collated "C" answers as memory does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 5ca7a14)
This was referenced Oct 26, 2026
Closed
…llation-10.x # Conflicts: # test/oracles/claims.json
CaffeinatedCoder
deleted the
fix/496-reject-nondeterministic-string-set-collation-10.x
branch
October 26, 2026 13:50
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.
Closes #496
Problem
On
release/10.x, a nondeterministic (case-insensitive) collation on aStringSetcolumn made the database answer differently from memory:Contains("a"),IsSubsetOf,Overlapsand==matched{A};ExecuteUpdatewithRemove("a")stored{}.mainrejects such a collation since #483 (PR #492, merged as 3776504).Change
Cherry-picked with
-x: 98e51a1 and 5ca7a14 from PR #492.StringSetCollationConventionthroughIConventionSetPluginrejects a collation on a string set column other thanC,POSIX,ucs_basic,pg_c_utf8anddefault. The guard refusesEF.Functions.Collateover a string set.StringSetCollationTestsandStringSetCollationIntegrationTests.[10.4.0]with "Some calls answer differently" and a### Changed answersrow linking 10.x: reject a collation on a string set column unless it compares bytes (port of #483) #496 and the migration guide.docs/migration.mdgets## Changed answers in 10.4.0with Check string set columns with a collation, the same text asmain's v10.x section.Tests
On EF Core 10.0.0, PostgreSQL 16 and 18: conventions (including the Changed answers checks), no-database EF tests, ASP.NET Core tests and the integration suite (318 tests). On the newest-patch leg: the collation tests. Re-proved on EF Core 10: without the plugin's registration both model-build tests fail.
🤖 Generated with Claude Code