-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
planner: don't push down predicates over table dual #35669
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/6ae53c526917b9963a50a269fd668227789d63d8 |
This change caused the above diff. |
@winoros I tried to print the logical plan in each step of logical optimization:
You can see the
The "predicate_push_down" rule tries to eliminate the selection by Anyway, even if the selection operator is not pushed down, it shouldn't report the error "Can't find column Column#1 in schema Column: [] Unique key: []". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 0325dbb
|
I used the wrong SQL for checking. Now i have no question( |
TiDB MergeCI notify🔴 Bad News! [1] CI still failing after this pr merged.
|
Signed-off-by: you06 <[email protected]> fix tests Signed-off-by: you06 <[email protected]> fix test Signed-off-by: you06 <[email protected]> update Signed-off-by: you06 <[email protected]> update bazel Signed-off-by: you06 <[email protected]> fix test Signed-off-by: you06 <[email protected]> fix test Signed-off-by: you06 <[email protected]> update Signed-off-by: you06 <[email protected]> update client-go Signed-off-by: you06 <[email protected]> update client-go Signed-off-by: you06 <[email protected]> update grafana Signed-off-by: you06 <[email protected]> update bazel Signed-off-by: you06 <[email protected]> display by stack Signed-off-by: you06 <[email protected]> set request source for ctx of Signed-off-by: you06 <[email protected]> address comment Signed-off-by: you06 <[email protected]> address comment Signed-off-by: you06 <[email protected]> parser, ddl: support decoding binary literal in set/enum (pingcap#35822) close pingcap#31338 executor: fix a nil point when @@tidb_enable_collect_execution_info is off and cop cache is on (pingcap#35839) close pingcap#35829 ddl: support drop columns for multi-schema change (pingcap#35737) ref pingcap#14766 planner: don't push down predicates over table dual (pingcap#35669) close pingcap#35527 *: Remove some useless staleness code (pingcap#35849) close pingcap#35848 ddl: fix potential wrong column definition when setting default value (pingcap#35845) close pingcap#35846 *: add timeout for test cases (pingcap#35844) ddl: remove `onDropColumns` and `onAddColumns` (pingcap#35862) ref pingcap#14766 *: Fix Dockerfile (pingcap#35835) close pingcap#35828 server: refactor TestConnExecutionTimeout (pingcap#35865) close pingcap#35868 fix test Signed-off-by: you06 <[email protected]> fix lint Signed-off-by: you06 <[email protected]>
What problem does this PR solve?
Issue Number: close #35527
Problem Summary:
When a table dual is used as view or subquery, the PPD(Predicate Push-Down) optimizer incorrectly pushes the predicate down to the table dual.
After rule-based optimization:
After the physical optimization, the columns in condition need to be relocated using the schema of child operator(it is
TableDual
here). As we know, the schema ofTableDual
is alwaysnil
. An error is occurred.What is changed and how it works?
This PR avoids to push the predicates to the
TableDual
, but keeps aProjection
over it instead.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.