Fix handling decimal for EF_DECIMAL collate. - #38891
Open
cincuranet wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
🟢 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_DECIMALcollation to usedecimal.TryParseand 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
OrderBysucceeds 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.
cincuranet
force-pushed
the
fix-ef-decimal
branch
from
September 1, 2026 09:46
18f7418 to
eb09603
Compare
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.
Fixes #38870