Repository navigation
docs: ordering by a bound puts the rows without it where PostgreSQL puts NULLs (10.x, port of #359) - #374
Merged
Conversation
…uts NULLs (#359) docs/ranges.md#sort-ranges documents PostgreSQL's NULLS LAST against memory's null-first for a nullable column, but not for an ordering by a bound, where the NULLs come from non-null ranges and so appear on a required column too, and the README, the EF Core README, docs/efcore.md and getting-started.md all show OrderBy(b => b.Period.LowerBound()) as their ordering example. docs/efcore.md gets a Good to know bullet with the placement (last ascending, first descending) and the two ways to sort otherwise: a Bound() != null key in front gives memory's order, ordering by the range gives the range order. The ranges.md bullet and the four examples point there. Claim E72. ExecutedQueryTests.OrderingByABound_PutsTheRowsWithoutItWherePostgresPutsNulls orders a range and a multirange column of every shape by each bound in both directions and asserts the documented placement and the keyed order. The seed bound-declared-null-only-for-a-null-argument.patch (#349 reverted) is caught by it and by the bound sweep. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 0fc386f)
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.
Closes #364
The 10.x port of #359 for 10.2.0 (#358):
git cherry-pick -xof #372's commit (0fc386f), merged intomain. Stacked on the #357 port, because both write the[10.2.0]changelog sections andclaims.json. Merge that first; GitHub then retargets this PR torelease/10.x. #364 is closed by hand after the merge.Problem
The 10.x docs have the same gap as #359.
docs/ranges.md#sort-rangesdocuments PostgreSQL's NULLS LAST against memory's null-first for a nullable column, but not for an ordering by a bound, where the NULLs appear on a required column too. Four examples order byLowerBound()with no word about it.Change
Docs, a test and a seed, as on
main:docs/efcore.md#read-bounds-merge-ranges-and-aggregate, the sentence indocs/ranges.md#sort-ranges, and the comments at the four examples (both READMEs,efcore.md,getting-started.md). Claim E72 quotes the bullet.ExecutedQueryTests.OrderingByABound_PutsTheRowsWithoutItWherePostgresPutsNulls.bound-declared-null-only-for-a-null-argument.patch, the LowerBound() and UpperBound() in a query: == null becomes WHERE FALSE and ?? max loses its COALESCE, because lower() and upper() are declared NULL only for a NULL argument #349 revert, which 10.x has fixed since fix: declare lower() and upper() NULL for a non-null range (10.x, port of #349) #367.### Fixedsection with theDocs:line in[10.2.0], after### Changed answers. The EF Core changelog got the same section from the pick.Tests
Local, SDK 10.0.402, Docker:
ExecutedQueryTests: 17/17 onpostgres:16-alpineandpostgres:18-alpineon the EF Core 10.0.0 floor, and on EF Core 10.0.13 with Npgsql 10.0.3.dotnet run tools/oracles.cs seeds bound-declaredon this branch reports it caught, 2 of 17 failing, among them the new ordering test.🤖 Generated with Claude Code