-
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: fix insert with select the same table result no error #issue 31363 #33565
base: master
Are you sure you want to change the base?
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. |
/cc @xhebox |
3ac5d37
to
f59d947
Compare
Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/3d7547d1ab7c2fa6c93efcb00ee5076e1b1ea78e |
/cc @winoros |
BTW, we don't cherry-pick minor issue. I am not sure about the fix, it looks like a fix in preprocessor will make more sense. |
f59d947
to
43da12a
Compare
/test all |
@fanrenhoo: Your PR was out of date, I have automatically updated it for you. If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
/hold unit-test failed. |
/test all |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: xhebox, xuyifangreeneyes The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test all |
@xhebox: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Signed-off-by: xhe <[email protected]>
/test all |
@xhebox: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@fanrenhoo: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Signed-off-by: xhe <[email protected]>
Signed-off-by: fanrenhoo [email protected]
What problem does this PR solve?
Issue Number: close #31363
Problem Summary: insert into with select query on a same table no error return, not compatible with MySQL
What is changed and how it works?
Added in the parser in InsertStmt with the logic, if has insert stmt has subquery select stmt, check to make sure select with different table or use as alias to a different name
Check List
Tests
mysql> drop table if exists t1;
mysql> CREATE TABLE t1 (x int);
mysql> INSERT INTO t1 (x) VALUES ((SELECT x FROM t1));ERROR 1093 (HY000): You can't specify target table 't1' for update in FROM clause
mysql> INSERT INTO t1 (x) VALUES ((SELECT x FROM t1 as t));
Query OK, 1 row affected (0.00 sec)
Side effects
no
Documentation
no
Release note