Skip to content
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

MySQL Bugs: #103665 The aliases interferes despite the fact that the database is specified #24594

Closed
ChenPeng2013 opened this issue May 12, 2021 · 2 comments · Fixed by #30061
Assignees
Labels
severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@ChenPeng2013
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE DATABASE db1;
CREATE TABLE db1.t(a INT);
INSERT INTO db1.t VALUES (1);
UPDATE db1.t, (SELECT 1 AS a) AS t SET db1.t.a=2;
UPDATE (SELECT 1 AS a) AS t, db1.t SET db1.t.a=2;

2. What did you expect to see? (Required)

update succeeded

3. What did you see instead (Required)

mysql> UPDATE db1.t, (SELECT 1 AS a) AS t SET db1.t.a=2;
ERROR 1288 (HY000): The target table t of the UPDATE is not updatable
mysql> UPDATE (SELECT 1 AS a) AS t, db1.t SET db1.t.a=2;
ERROR 1288 (HY000): The target table t of the UPDATE is not updatable

4. What is your TiDB version? (Required)

Release Version: v4.0.0-beta.2-2832-gc6c8265e0-dirty
Edition: Community
Git Commit Hash: c6c8265e098b65339a85be2e35678b1c13f0f53a
Git Branch: master
UTC Build Time: 2021-05-10 14:58:41
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
@AilinKid
Copy link
Contributor

AilinKid commented Nov 24, 2021

this issue is fixed by:

commit e92df20 (HEAD)
Author: xiongjiwei xiongjiwei1996@outlook.com
Date: Fri May 14 19:09:38 2021 +0800
planner: fix wrongly check for update statement (#24614)

And this PR is refactored by #30061 which is more clear, so let's cherry-pick 30061 if necessary

@github-actions
Copy link

Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants