Skip to content

Fix handling decimal for EF_DECIMAL collate. - #38891

Open
cincuranet wants to merge 1 commit into
dotnet:mainfrom
cincuranet:fix-ef-decimal
Open

Fix handling decimal for EF_DECIMAL collate.#38891
cincuranet wants to merge 1 commit into
dotnet:mainfrom
cincuranet:fix-ef-decimal

Conversation

@cincuranet

Copy link
Copy Markdown
Contributor

Fixes #38870

Copilot AI lite review requested due to automatic review settings September 1, 2026 09:29
@cincuranet
cincuranet requested a review from a team as a code owner September 1, 2026 09:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Pull request overview

This pull request addresses SQLite EF_DECIMAL collation robustness by eliminating managed exceptions from the collation callback, which previously could terminate the process when encountering non-numeric values during ORDER BY over decimal-mapped columns.

Changes:

  • Updated the EF_DECIMAL collation to use decimal.TryParse and produce a deterministic total ordering even for non-parseable values.
  • Added a functional test that injects invalid/non-decimal values into a decimal column and verifies OrderBy succeeds and produces stable ordering semantics.
File summaries
File Description
test/EFCore.Sqlite.FunctionalTests/BuiltInDataTypesSqliteTest.cs Adds coverage ensuring ORDER BY on decimal columns works even with invalid database values and asserts SQL uses COLLATE "EF_DECIMAL".
src/EFCore.Sqlite.Core/Storage/Internal/SqliteRelationalConnection.cs Makes EF_DECIMAL collation non-throwing and total by using TryParse and ordinal fallback comparisons for invalid values.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Copilot AI review requested due to automatic review settings September 1, 2026 09:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

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.

SQLite: EF_DECIMAL collation terminates the process on a non-numeric value in a decimal column

2 participants