Skip to content

Fix Turkish culture (dotless-i) corruption of SQL identifiers#2480

Merged
jeremydmiller merged 1 commit into
mainfrom
fix/2472-turkish-collation
Apr 9, 2026
Merged

Fix Turkish culture (dotless-i) corruption of SQL identifiers#2480
jeremydmiller merged 1 commit into
mainfrom
fix/2472-turkish-collation

Conversation

@jeremydmiller

Copy link
Copy Markdown
Member

Summary

Fixes #2472 — SQL Server Turkish collation causes envelope storage setup errors.

  • Replace culture-sensitive ToLower() with ToLowerInvariant() in all SQL identifier normalization paths
  • In Turkish locale (tr-TR), "I".ToLower() produces dotless ı instead of i, corrupting SQL object names used in envelope storage (queue/table identifiers, saga table names)
  • Affected: SqlServerTransport, PostgresqlTransport, MySqlTransport, SqliteTransport, and SagaTableDefinition

Root cause

SanitizeIdentifier() in each transport and defaultTableName() in SagaTableDefinition were using String.ToLower() (culture-sensitive). Under tr-TR culture, uppercase I maps to dotless ı (U+0131) rather than i (U+0069), producing invalid SQL identifiers like ıncoming instead of incoming.

Test plan

  • Added regression test sanitize_identifier_is_culture_invariant that sets CultureInfo.CurrentCulture to tr-TR and verifies SanitizeIdentifier("INCOMING") returns "incoming" (not "ıncoming")
  • All 5 affected projects build successfully with no errors
  • Run SqlServerTests with SQL Server available to verify integration tests pass

🤖 Generated with Claude Code

Replace culture-sensitive ToLower() with ToLowerInvariant() in all SQL identifier
normalization paths. In Turkish locale, 'I'.ToLower() produces dotless 'ı' instead
of 'i', corrupting SQL names such as queue/table identifiers used in envelope storage.

Affects SqlServerTransport, PostgresqlTransport, MySqlTransport, SqliteTransport,
and SagaTableDefinition. Adds a regression test that verifies SanitizeIdentifier
behaves correctly under tr-TR culture.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jeremydmiller added a commit to JasperFx/weasel that referenced this pull request Apr 9, 2026
…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 to JasperFx/weasel that referenced this pull request Apr 9, 2026
…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 jeremydmiller merged commit 38618c8 into main Apr 9, 2026
17 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resource Envelope Storage Setup Error due to SqlServer Turkish Collation

1 participant