Skip to content

[9.0] Translate ToString on string expressions - #4051

Merged
roji merged 1 commit into
hotfix/9.0.5from
roji-string-tostring-backport-9-0
Oct 20, 2026
Merged

roji merged 1 commit into
hotfix/9.0.5from
roji-string-tostring-backport-9-0

Conversation

@roji

@roji roji commented Oct 20, 2026

Copy link
Copy Markdown
Member

Backport #4047 to hotfix/9.0.5.

Return string-mapped SQL expressions unchanged in NpgsqlObjectToStringTranslator, matching SQL Server and SQLite. Adapt the four focused regressions to this branch's existing Northwind functions suite, covering string predicates, null propagation, and object-typed string grouping keys used in OrderBy and Where. Retain SQL assertions for the inherited string projection test in GearsOfWar, TPC, and TPT.

Validation: .NET SDK 9.0.312, xUnit/VSTest, isolated PostgreSQL 17 (no shared database). All 485 selected Northwind functions and ToString tests passed. Removing the translator fix makes all eight new sync/async regression cases fail.

Related to dotnet/efcore#20839, fixed upstream in dotnet/efcore#29349.

Fixes #4046.

Backport #4047, adapting focused regressions to the existing Northwind functions suite. Retain inherited GearsOfWar, TPC and TPT projection SQL assertions.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 8445f728-0ea4-4167-ac34-f40a4d7e9657
@roji
roji merged commit 714b69e into hotfix/9.0.5 Oct 20, 2026
10 checks passed
@roji
roji deleted the roji-string-tostring-backport-9-0 branch October 20, 2026 12:51
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.

ToString() on a string expression fails to translate (“Translation of method ‘object.ToString’ failed”)

1 participant