opt: fix rare incorrect results due to sort between paired joins#92632
opt: fix rare incorrect results due to sort between paired joins#92632craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
|
TFTR! Yeah, it helped to talk things through as a pair-programming project. Still might be ideal to make it a single operator or something, but this seems like the easiest fix considering it's probably a pretty rare bug. The test failures are the same as #92536, so unrelated. |
pkg/sql/opt/ordering/ordering.go
Outdated
There was a problem hiding this comment.
nit: that to handle -> to handle
nit: enforcing a sort -> adding a sort (or enforcing an ordering)
|
Consider also adding a backport label for 22.2 and 22.1 |
1040cfa to
a404527
Compare
Previously, it was possible for paired joins to produce incorrect results in the case when an ordering was required of their output, and a sort was added between the paired joins to enforce the ordering. This patch prevents a sort from being added to the output of the first join in a set of paired joins. This is necessary because the continuation column that is used to indicate false positives matched by the first join relies on the ordering being maintained between the joins. Fixes cockroachdb#89603 Release note: None
|
TFTRs! |
a404527 to
7cfcce1
Compare
|
The linter failure is a known issue. bors r+ |
|
Build succeeded: |
|
Encountered an error creating backports. Some common things that can go wrong:
You might need to create your backport manually using the backport tool. error creating merge commit from 7cfcce1 to blathers/backport-release-22.1-92632: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch 22.1.x failed. See errors above. error creating merge commit from 7cfcce1 to blathers/backport-release-22.2-92632: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch 22.2.x failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
Previously, it was possible for paired joins to produce incorrect results in the case when an ordering was required of their output, and a sort was added between the paired joins to enforce the ordering.
This patch prevents a sort from being added to the output of the first join in a set of paired joins. This is necessary because the continuation column that is used to indicate false positives matched by the first join relies on the ordering being maintained between the joins.
Fixes #89603
Release note: None