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

buildUpdateLists has some confusion with updatable-table and non-updatable table (eg: subquery with alias) #30031

Closed
AilinKid opened this issue Nov 23, 2021 · 1 comment · Fixed by #30061
Assignees
Labels
affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@AilinKid
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

mysql> create table t(a int default -1, c int as (a+10) stored);
Query OK, 0 rows affected (0.04 sec)

mysql> insert into t(a) values(1);
Query OK, 1 row affected (0.00 sec)

mysql> update test.t, (select 1 as b) as t set test.t.a=default;
Query OK, 1 row affected (0.02 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> select * from t;
+------+------+
| a    | c    |
+------+------+
|   -1 |   11 |
+------+------+
1 row in set (0.00 sec)

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

new result of generated column stored should be 9

3. What did you see instead (Required)

11

4. What is your TiDB version? (Required)

master

some details: it is caused by the table name resolver confusion in build update (exactly in b.buildUpdateLists)

@AilinKid AilinKid added the type/bug The issue is confirmed as a bug. label Nov 23, 2021
@AilinKid AilinKid changed the title buildUpdateLists has some confusion with updatable table and unupdatable buildUpdateLists has some confusion with updatable-table and non-updatable table(eg: subquery with alias) Nov 23, 2021
@AilinKid AilinKid changed the title buildUpdateLists has some confusion with updatable-table and non-updatable table(eg: subquery with alias) buildUpdateLists has some confusion with updatable-table and non-updatable table (eg: subquery with alias) Nov 23, 2021
@AilinKid AilinKid self-assigned this Nov 23, 2021
@AilinKid AilinKid added the sig/planner SIG: Planner label Nov 23, 2021
@ChenPeng2013 ChenPeng2013 added affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. severity/major labels Nov 23, 2021
@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
affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. 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.

2 participants