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

execute DDL failed but actually take effect #17356

Closed
crazycs520 opened this issue May 22, 2020 · 0 comments · Fixed by #17341
Closed

execute DDL failed but actually take effect #17356

crazycs520 opened this issue May 22, 2020 · 0 comments · Fixed by #17341
Assignees
Labels
severity/major type/bug The issue is confirmed as a bug.

Comments

@crazycs520
Copy link
Contributor

crazycs520 commented May 22, 2020

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

For truncate table, if there is an error when updateSchemaVersion, before this PR, we will get error like below:

mysql>show tables;
+-----------------+
| Tables_in_test2 |
+-----------------+
| t               |
+-----------------+
1 row in set
Time: 0.006s
mysql>truncate table t; -- actually the table t was already been truncated.
(1146, u"Table '(Schema ID 40063).(Table ID 40067)' doesn't exist")
mysql>truncate table t
(1146, u"Table '(Schema ID 40063).(Table ID 40067)' doesn't exist")

Manual mock an error as below:

image

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

If run DDL failed, it should never task any effect.

3. What did you see instead (Required)

4. Affected version (Required)

mysql>select tidb_version();
+-------------------------------------------------------------------+
| tidb_version()                                                    |
+-------------------------------------------------------------------+
| Release Version: v4.0.0-beta.2-243-g004198fd3                     |
| Git Commit Hash: 4078eb4ae5ae2036ff7f60a7585cbc3c5601e448         |
| Git Branch: HEAD                                                  |
| UTC Build Time: 2020-05-21 10:41:38                               |
| GoVersion: go1.13.4                                               |
| Race Enabled: false                                               |
| TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306 |
| Check Table Before Drop: false                                    |
+-------------------------------------------------------------------+
1 row in set
Time: 0.055s

5. Root Cause Analysis

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

Successfully merging a pull request may close this issue.

2 participants