Use explicit ordering in RawSqlTest#1139
Merged
MaxGabriel merged 2 commits intomasterfrom Oct 25, 2020
Merged
Conversation
I was non-deterministically getting an error on this test, where the pets were misordered. I'm having trouble reproducing, but I believe the issue is that Postgres' order is non-deterministic if not specified (in my experience, it can be Postgres version dependent). I believe the test as-is is incorrect without specifying the pet order, for Postgres. [Postgres docs warn:](https://www.postgresql.org/docs/12/queries-order.html) > After a query has produced an output table (after the select list has been processed) it can optionally be sorted. If sorting is not chosen, the rows will be returned in an unspecified order. The actual order in that case will depend on the scan and join plan types and the order on disk, but it must not be relied on. A particular output ordering can only be guaranteed if the sort step is explicitly chosen. This commit orders the pets explicitly. This ensures when we get both of Mathias' pets, we get "Rodolfo" first and "Zeno" second, as the assertions require.
Member
Author
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.
I was non-deterministically getting an error on this test, where the pets were misordered. I'm having trouble reproducing, but I believe the issue is that Postgres' order is non-deterministic if not specified (in my experience, it can be Postgres version dependent). I believe the test as-is is incorrect without specifying the pet order, for Postgres.
Postgres docs warn:
This commit orders the pets explicitly. This ensures when we get both of Mathias' pets, we get "Rodolfo" first and "Zeno" second, as the assertions require.
Before submitting your PR, check that you've:
@sincedeclarations to the HaddockAfter submitting your PR:
(unreleased)on the Changelog