fix: use ToLowerInvariant/ToUpperInvariant for SQL identifiers (Turkish collation bug)#247
Merged
Merged
Conversation
When a table's primary key is dropped and recreated via ALTER TABLE ... DROP CONSTRAINT ... CASCADE, PostgreSQL also drops foreign keys from other tables that reference the PK. Previously these referencing FKs were not recreated, leaving the schema in an inconsistent state. The fix: - In TableDelta.PostProcess(), scan all other table deltas for FKs that reference this table when the PK is being changed - Store those referencing FKs in a new ReferencingForeignKeys list - In writePrimaryKeyChanges(), after recreating the PK, emit ALTER TABLE ... ADD CONSTRAINT for each referencing FK Closes #45 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…QL identifiers In Turkish locale (tr-TR), String.ToLower() converts 'I' to dotless 'ı' (U+0131) instead of 'i', corrupting SQL identifiers (e.g. INFORMATION_SCHEMA → ınformation_schema). Replace all .ToLower()/.ToUpper() calls that operate on SQL identifiers, schema names, column names, type names, and keywords with .ToLowerInvariant()/.ToUpperInvariant(). Adds unit tests that set CultureInfo.CurrentCulture = tr-TR to verify correct normalization. Upstream fix for JasperFx/wolverine#2472 (companion PR to JasperFx/wolverine#2480). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jeremydmiller
added a commit
that referenced
this pull request
May 13, 2026
Refreshes the AOT-cleanup PR forward to the foundation alphas that just shipped from #247 / #250 (the IsAotCompatible=true flip and the CommandLine reflective surface annotation pass). Adopting these gives Weasel.Core / Weasel.* the precise [RequiresUnreferencedCode] / [RequiresDynamicCode] annotations on JasperFx.CommandLine entry points in time for the 9.0.0-alpha.3 cut. Carries the existing weasel#265 + weasel#266 fixes from the original alpha.8 bump branch: - AssertCommand override carries [UnconditionalSuppressMessage("AOT", "IL3050")] for the dev-time Spectre.Console exception writer (#265) - CommandBuilderBase.AddParameters(object) carries [RequiresUnreferencedCode] for the runtime reflection it does (#266) Local Weasel.Core build clean against alpha.11 / alpha.4. The next Publish Nugets workflow run cuts Weasel.* 9.0.0-alpha.3 (Directory.Build.props is already at that version line).
jeremydmiller
added a commit
that referenced
this pull request
May 13, 2026
) Refreshes the AOT-cleanup PR forward to the foundation alphas that just shipped from #247 / #250 (the IsAotCompatible=true flip and the CommandLine reflective surface annotation pass). Adopting these gives Weasel.Core / Weasel.* the precise [RequiresUnreferencedCode] / [RequiresDynamicCode] annotations on JasperFx.CommandLine entry points in time for the 9.0.0-alpha.3 cut. Carries the existing weasel#265 + weasel#266 fixes from the original alpha.8 bump branch: - AssertCommand override carries [UnconditionalSuppressMessage("AOT", "IL3050")] for the dev-time Spectre.Console exception writer (#265) - CommandBuilderBase.AddParameters(object) carries [RequiresUnreferencedCode] for the runtime reflection it does (#266) Local Weasel.Core build clean against alpha.11 / alpha.4. The next Publish Nugets workflow run cuts Weasel.* 9.0.0-alpha.3 (Directory.Build.props is already at that version line).
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.
Summary
tr-TR),String.ToLower()converts'I'to dotless'ı'(U+0131) instead of'i', which corrupts SQL identifiers (e.g.INFORMATION_SCHEMA→ınformation_schema).ToLower()/.ToUpper()calls on SQL identifiers, schema names, column names, type names, and DDL keywords with.ToLowerInvariant()/.ToUpperInvariant()Files changed:
Test plan
🤖 Generated with Claude Code