Push down derived tables under route when possible#11422
Merged
systay merged 1 commit intovitessio:release-14.0from Oct 3, 2022
Merged
Push down derived tables under route when possible#11422systay merged 1 commit intovitessio:release-14.0from
systay merged 1 commit intovitessio:release-14.0from
Conversation
Backport of vitessio#11379 * tests: add more plan_tests for derived tables and subqueries Co-authored-by: Arthur Schreiber <arthurschreiber@github.com> Signed-off-by: Andres Taylor <andres@planetscale.com> * refactor: make switch pretty Signed-off-by: Andres Taylor <andres@planetscale.com> * feat: push derived table under the route Signed-off-by: Harshit Gangal <harshit@planetscale.com> * simplify logic Signed-off-by: Andres Taylor <andres@planetscale.com> * check for valid derived tables also when doing JOIN on the vtgate Signed-off-by: Andres Taylor <andres@planetscale.com> * comments Signed-off-by: Andres Taylor <andres@planetscale.com> * add more tests with derived tables Signed-off-by: Andres Taylor <andres@planetscale.com> * handle HAVING in derived tables correctly Signed-off-by: Andres Taylor <andres@planetscale.com> * merge tests into single file Signed-off-by: Andres Taylor <andres@planetscale.com> * rename test keypspace Signed-off-by: Andres Taylor <andres@planetscale.com> Signed-off-by: Andres Taylor <andres@planetscale.com> Signed-off-by: Harshit Gangal <harshit@planetscale.com> Co-authored-by: Arthur Schreiber <arthurschreiber@github.com> Co-authored-by: Harshit Gangal <harshit@planetscale.com>
Contributor
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
If a new flag is being introduced:
If a workflow is added or modified:
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
harshit-gangal
approved these changes
Oct 3, 2022
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.
Backport of #11379
Description
Fixes bugs with the following queries:
In all these queries, having aggregation and/or LIMIT in a derived table on the RHS of a join leads to potentially bad results.
Related Issue(s)
Fixes #11093
Backport of #11379