Skip to content

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

Closed
@AilinKid

Description

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

affects-5.1This bug affects 5.1.x versions.affects-5.2This bug affects 5.2.x versions.affects-5.3This bug affects 5.3.x versions.severity/majorsig/plannerSIG: Plannertype/bugThe issue is confirmed as a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions