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

*: fix updating the column value when the column is dropping and in WriteOnly state (#15539) #15576

Merged
merged 6 commits into from
Apr 4, 2020

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Mar 23, 2020

cherry-pick #15539 to release-3.0
conflicts:

  • ddl/db_change_test.go
  • executor/update.go
  • planner/core/logical_plan_builder.go

Some variables and functions in v4.0 are not in v3.0, I hope that reviewers will be more careful



What problem does this PR solve?

Issue Number: close #15386

create table t (a int, b int)
insert into t values(1,1);

Do the following:

time connection1 connection2
t1 drop column
t2 column state (write only) update t set a =5 ,b=2
t3 column state (write only) update t set a=10 where b=2
t4 column state (none) select * from t

The result:

tidb> select * from t;
+------+
| a |
+------+
| 5 |
+------+
1 row in set (0.00 sec)

Problem Summary:
When the column is dropping and in WriteOnly state, the value of this column cannot be explicitly updated.

What is changed and how it works?

What's Changed:
When the column is in a falling state and in WriteOnly state, if we update this column value explicitly, an error will be returned.

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test

Side effects

  • Performance regression
    • Consumes more CPU
    • Consumes more MEM
  • Breaking backward compatibility

Release note

Signed-off-by: sre-bot <sre-bot@pingcap.com>
@sre-bot
Copy link
Contributor Author

sre-bot commented Mar 23, 2020

/run-all-tests

@zimulala
Copy link
Contributor

Some variables and functions in v4.0 are not in v3.0, I hope that reviewers will be more careful

@zimulala
Copy link
Contributor

PTAL @crazycs520 @tangenta @AilinKid

@qw4990 qw4990 removed their request for review March 25, 2020 08:25
return i
}
}
panic("Couldn't get column information when do update/delete")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Panic?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add error for getTableOffset.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@zimulala
Copy link
Contributor

zimulala commented Apr 2, 2020

PTAL @tangenta @bb7133

Copy link
Contributor

@AilinKid AilinKid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AilinKid AilinKid added the status/LGT1 Indicates that a PR has LGTM 1. label Apr 3, 2020
Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zz-jason zz-jason added status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Apr 4, 2020
@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 4, 2020

Your auto merge job has been accepted, waiting for 15356

@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 4, 2020

/run-all-tests

@sre-bot sre-bot merged commit 46485b6 into pingcap:release-3.0 Apr 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution sig/sql-infra SIG: SQL Infra status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug. type/3.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants