You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GuidSet accepts whitespace inside an element that PostgreSQL's uuid_in rejects #78
GuidSet accepts whitespace inside an element that PostgreSQL's uuid_in rejects.
GuidSet.Parse("{\" 6f9619ff-8b86-d011-b42d-00cf4fc964ff\"}",null);// parsesGuidSet.Parse("{\\ 6f9619ff-8b86-d011-b42d-00cf4fc964ff}",null);// parsesGuidSet.Parse("{ 6f9619ff-8b86-d011-b42d-00cf4fc964ff}",null);// parses, even bare
SELECT'{" 6f9619ff-8b86-d011-b42d-00cf4fc964ff"}'::uuid[]; -- invalid input syntax for type uuidSELECT'{ 6f9619ff-8b86-d011-b42d-00cf4fc964ff}'::uuid[]; -- fine: array_in drops bare ASCII whitespace
This was measured on PostgreSQL 17 while fixing #70; the table is in the comment there. GuidSet.ParseValue calls Guid.Parse, which trims all Unicode whitespace. uuid_in trims none. Bare ASCII whitespace is fine, because array_in drops it before uuid_in sees the element. A no-break space isn't ASCII, so array_in keeps it and uuid_in rejects it.
The library doesn't return a wrong value here. It parses text that PostgreSQL rejects, so {" …"} parses in memory and then fails when it reaches the database as a literal. Fixing it means rejecting input that parses today, so it belongs in 10.0.0, not a minor. It should also cover GuidSet<T>, which parses as Guid first.
Oracle check (main at 3ecfa10):Would be caught today (retroactive; it was found while fixing #70, not by an oracle) by SetElementWhiteSpaceContractTests and LiteralGrammarParityTests. The failing rows: SetElementWhiteSpaceContractTests (rows GuidSet: accepts whitespace uuid_in rejects and GuidSet<TenantId>: …, through Parse, TryParse, TypeConverter and JSON) and LiteralGrammarParityTests (ElementWhitespace_ReadsAsPostgresReadsIt, row uuid[] GuidSet ). Verified by a run on 3ecfa10, where the defect is unfixed. 162 lines report SKIPPED [known candidate: Guid.Parse trims whitespace uuid_in rejects, #78] from candidates.json, and they will fail as candidate fixed once the fix lands.
Would be caught today by LiteralCorpusProbeTests (#135), alongside SetElementWhiteSpaceContractTests and LiteralGrammarParityTests, which found it. Row: GuidSet whitespace {00000000-0000-0000-0000-000000000001 } (and {" …"}, {\ …}): library reads the uuid, PostgreSQL refuses. The same holds for GuidSet<TenantId>. Verified against postgres:17 on main + #135, where the defect is still present. The proof is the candidates.json rows GuidSet whitespace / GuidSet<TenantId> whitespace → #78. The related Guid.Parse grammar cells (the (…) form accepted, hyphen groups refused) are #129.
Fixed in #162 (with #129, one change): GuidSet.ParseValue reads uuid_in's grammar through the new UuidLiteral, so whitespace inside a quoted or escaped element is refused (FormatException) through Parse, TryParse, the TypeConverter and JSON, for GuidSet and GuidSet<T> alike; bare ASCII whitespace around an element is still dropped by the array grammar, as array_in drops it. SetElementWhiteSpaceContractTests, LiteralGrammarParityTests and LiteralCorpusProbeTests hold their Guid rows without candidates. Proven by reverting the fix.
Activity
CaffeinatedCoder commentedon Oct 17, 2026
Oracle check (main at 3ecfa10): Would be caught today (retroactive; it was found while fixing #70, not by an oracle) by
SetElementWhiteSpaceContractTestsandLiteralGrammarParityTests. The failing rows:SetElementWhiteSpaceContractTests(rowsGuidSet: accepts whitespace uuid_in rejectsandGuidSet<TenantId>: …, through Parse, TryParse, TypeConverter and JSON) andLiteralGrammarParityTests(ElementWhitespace_ReadsAsPostgresReadsIt, rowuuid[] GuidSet).Verified by a run on 3ecfa10, where the defect is unfixed. 162 lines report
SKIPPED [known candidate: Guid.Parse trims whitespace uuid_in rejects, #78]fromcandidates.json, and they will fail ascandidate fixedonce the fix lands.CaffeinatedCoder commentedon Oct 17, 2026
Would be caught today by
LiteralCorpusProbeTests(#135), alongsideSetElementWhiteSpaceContractTestsandLiteralGrammarParityTests, which found it. Row:GuidSet whitespace {00000000-0000-0000-0000-000000000001 }(and{" …"},{\ …}): library reads the uuid, PostgreSQL refuses. The same holds forGuidSet<TenantId>. Verified against postgres:17 on main + #135, where the defect is still present. The proof is thecandidates.jsonrowsGuidSet whitespace/GuidSet<TenantId> whitespace→ #78. The relatedGuid.Parsegrammar cells (the(…)form accepted, hyphen groups refused) are #129.test: literal corpus × entry point against PostgreSQL (route B, step 3)
CaffeinatedCoder commentedon Oct 18, 2026
Fixed in #162 (with #129, one change):
GuidSet.ParseValuereadsuuid_in's grammar through the newUuidLiteral, so whitespace inside a quoted or escaped element is refused (FormatException) throughParse,TryParse, theTypeConverterand JSON, forGuidSetandGuidSet<T>alike; bare ASCII whitespace around an element is still dropped by the array grammar, asarray_indrops it.SetElementWhiteSpaceContractTests,LiteralGrammarParityTestsandLiteralCorpusProbeTestshold their Guid rows without candidates. Proven by reverting the fix.