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

Wrong update result when stored there's generated column and subquery in UPDATE #13201

Closed
winoros opened this issue Nov 6, 2019 · 0 comments · Fixed by #13208
Closed

Wrong update result when stored there's generated column and subquery in UPDATE #13201

winoros opened this issue Nov 6, 2019 · 0 comments · Fixed by #13208
Assignees
Labels
type/bug The issue is confirmed as a bug.

Comments

@winoros
Copy link
Member

winoros commented Nov 6, 2019

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
CREATE TABLE `test_gc_read` (
  `a` int(11) NOT NULL,
  `b` int(11) DEFAULT NULL,
  `c` int(11) GENERATED ALWAYS AS (`a` + `b`) VIRTUAL,
  `d` int(11) GENERATED ALWAYS AS (`a` * `b`) STORED,
  `e` int(11) GENERATED ALWAYS AS (`c` * 2) VIRTUAL,
  PRIMARY KEY (`a`)
);
create table t1(a int);
insert into test_gc_read (a, b) values(3, 4);
insert into t1 values(3);
update test_gc_read set a = a + 100 where a in (select a from t1);
  1. What did you expect to see?

Both the value of a, c, d, e changed.

  1. What did you see instead?

The value of d is not changed.

  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
@winoros winoros added the type/bug The issue is confirmed as a bug. label Nov 6, 2019
@winoros winoros self-assigned this Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant