Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected override IEnumerable<MySqlQueue> endpoints()

public override string SanitizeIdentifier(string identifier)
{
return identifier.Replace('-', '_').ToLower();
return identifier.Replace('-', '_').ToLowerInvariant();
}

protected override MySqlQueue findEndpointByUri(Uri uri)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Globalization;
using IntegrationTests;
using JasperFx.Core;
using Shouldly;
Expand All @@ -20,4 +21,25 @@ public void retrieve_queue_by_uri()
var queue = theTransport.GetOrCreateEndpoint("sqlserver://one".ToUri());
queue.ShouldBeOfType<SqlServerQueue>().Name.ShouldBe("one");
}

// Regression test for https://github.com/JasperFx/wolverine/issues/2472
// Turkish culture maps 'I'.ToLower() to dotless 'ı' instead of 'i',
// which corrupts SQL identifiers when SanitizeIdentifier uses ToLower().
[Fact]
public void sanitize_identifier_is_culture_invariant()
{
var originalCulture = CultureInfo.CurrentCulture;
try
{
CultureInfo.CurrentCulture = new CultureInfo("tr-TR");

// "INCOMING" contains 'I' — Turkish ToLower() would produce "ıncomıng"
theTransport.SanitizeIdentifier("INCOMING").ShouldBe("incoming");
theTransport.SanitizeIdentifier("My-Queue-Name").ShouldBe("my_queue_name");
}
finally
{
CultureInfo.CurrentCulture = originalCulture;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected override IEnumerable<PostgresqlQueue> endpoints()

public override string SanitizeIdentifier(string identifier)
{
return identifier.Replace('-', '_').ToLower();
return identifier.Replace('-', '_').ToLowerInvariant();
}

protected override PostgresqlQueue findEndpointByUri(Uri uri)
Expand Down
4 changes: 2 additions & 2 deletions src/Persistence/Wolverine.RDBMS/Sagas/SagaTableDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ private static string defaultTableName(Type documentType)
nameToAlias = _aliasSanitizer.Replace(documentType.GetPrettyName(), string.Empty).Replace(",", "_");
}

var parts = new List<string> { nameToAlias.ToLower() };
var parts = new List<string> { nameToAlias.ToLowerInvariant() };
if (documentType.IsNested)
{
parts.Insert(0, documentType.DeclaringType!.Name.ToLower());
parts.Insert(0, documentType.DeclaringType!.Name.ToLowerInvariant());
}

return string.Join("_", parts);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ protected override IEnumerable<Endpoint> explicitEndpoints()

public override string SanitizeIdentifier(string identifier)
{
return identifier.Replace('-', '_').ToLower();
return identifier.Replace('-', '_').ToLowerInvariant();
}

protected override SqlServerQueue findEndpointByUri(Uri uri)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ protected override IEnumerable<SqliteQueue> endpoints()

public override string SanitizeIdentifier(string identifier)
{
return identifier.Replace('-', '_').ToLower();
return identifier.Replace('-', '_').ToLowerInvariant();
}

protected override SqliteQueue findEndpointByUri(Uri uri)
Expand Down
Loading