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

ddl: fix drop index failed when index contain auto_increment column and the auto_increment column is primary key #15861

Merged
merged 9 commits into from
Apr 1, 2020

Conversation

crazycs520
Copy link
Contributor

Signed-off-by: crazycs520 crazycs520@gmail.com

What problem does this PR solve?

Before this PR:

mysql>create table t3 (a int auto_increment key, b int, index idx(b,a))
Query OK, 0 rows affected
Time: 0.074s
mysql>alter table t3 drop index idx;   -- should sucessful.
(1075, u'Incorrect table definition; there can be only one auto column and it must be defined as a key')

What is changed and how it works?

Fix DDL drop index with auto_increament check function bug.

Related changes

Check List

Tests

  • Unit test
  • Manual test (add detailed scripts or steps below)

Side effects

Release note

Fix issue of drop index failed when index contain auto_increment column and the auto_increment column is the primary key.

…nd the auto_increment column is primary key

Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
@codecov
Copy link

codecov bot commented Mar 30, 2020

Codecov Report

Merging #15861 into master will not change coverage by %.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             master     #15861   +/-   ##
===========================================
  Coverage   80.5901%   80.5901%           
===========================================
  Files           505        505           
  Lines        135529     135529           
===========================================
  Hits         109223     109223           
  Misses        17821      17821           
  Partials       8485       8485           

@crazycs520
Copy link
Contributor Author

/run-all-tests

@crazycs520 crazycs520 added the type/bugfix This PR fixes a bug. label Mar 31, 2020
@tiancaiamao
Copy link
Contributor

LGTM

@tiancaiamao tiancaiamao added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 31, 2020
ddl/serial_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@zimulala zimulala left a comment

Choose a reason for hiding this comment

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

LGTM

@zimulala zimulala added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Apr 1, 2020
@crazycs520 crazycs520 added needs-cherry-pick-2.1 status/can-merge Indicates a PR has been approved by a committer. labels Apr 1, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Apr 1, 2020

Your auto merge job has been accepted, waiting for 15907, 15845, 15758, 15956, 15776, 15889, 15926, 15889

@sre-bot
Copy link
Contributor

sre-bot commented Apr 1, 2020

/run-all-tests

@sre-bot sre-bot merged commit 664d5bb into pingcap:master Apr 1, 2020
@you06
Copy link
Contributor

you06 commented Apr 2, 2020

/run-cherry-picker

sre-bot pushed a commit to sre-bot/tidb that referenced this pull request Apr 2, 2020
Signed-off-by: sre-bot <sre-bot@pingcap.com>
@sre-bot
Copy link
Contributor

sre-bot commented Apr 2, 2020

cherry pick to release-2.1 in PR #16007

@sre-bot
Copy link
Contributor

sre-bot commented Apr 2, 2020

cherry pick to release-3.0 in PR #16008

@sre-bot
Copy link
Contributor

sre-bot commented Apr 2, 2020

cherry pick to release-3.1 in PR #16009

@sre-bot
Copy link
Contributor

sre-bot commented Apr 2, 2020

cherry pick to release-4.0 in PR #16010

crazycs520 added a commit to crazycs520/tidb that referenced this pull request Apr 9, 2020
…nd the auto_increment column is primary key (pingcap#15861)

Signed-off-by: crazycs520 <crazycs520@gmail.com>
bb7133 pushed a commit that referenced this pull request Apr 14, 2020
…nd more than 2 index contain auto_increment_column (#12230) (#15861) (#16247)
sre-bot added a commit that referenced this pull request Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants