Repository navigation
test(aggregates): cover an overflow below the range and the words sqlite sends - #1019
Merged
Merged
Conversation
…ite sends A sum of two -1e308 rows overflows to -INF the same way two 1e308 rows overflow to INF, so sum() and aggregate() are now held to refuse it on SQLite in both fetch modes, Memory and, through the adapter E2E, every engine. The negative rows sit in their own collection so the unfiltered fast path stays order-independent. sumOf() is also held to read INF, -INF, Inf and NAN as the doubles they name and any other word as 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 34 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Follow-up to #1018, tests only.
#1018 held
sum()andaggregate()to refuse a double that overflows toINF. These tests also hold them to the cases it left unexercised:-1e308rows overflow to-INF.sum()andaggregate([sum])/aggregate([avg])refuse it withException\Limit:tests/unit/SumOverflowTest.php::testANegativeSumThatOverflowsIsRefusedcovers SQLite in both fetch modes and Memory.tests/unit/AggregateOverflowTest.php::testAnAggregateThatOverflowsBelowTheRangeIsRefusedcovers SQLite in both fetch modes, for sum, avg and an unaliased sum.tests/e2e/Adapter/Scopes/DocumentTests.php::testNegativeSumOverflowIsRefusedcovers every adapter, unfiltered, bounded and filtered. The rows are in their own collection so the unfiltered fast path does not depend on row order.tests/e2e/Adapter/Scopes/AggregationTests.php::testFloatAggregateOverflowIsRefusedadds asunkseries for sum and avg.tests/unit/Adapter/SumResultTest.phpholdssumOf()to readINF,-INFandInfas the infinities,NANas NaN, and any other word as0.Against the source before #1018, every new unit case fails. Counting #1018's own cases, the three files fail 6, 9 and 13 cases. All of them pass at main. Pint and PHPStan are clean on the changed files.
🤖 Generated with Claude Code