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 'alter table drop partition' check on hash partitioned table #10902

Merged
merged 2 commits into from Jun 21, 2019

Conversation

tiancaiamao
Copy link
Contributor

@tiancaiamao tiancaiamao commented Jun 21, 2019

What problem does this PR solve?

Before:

mysql> CREATE TABLE `t1` (
    ->   `a` int(11) DEFAULT NULL,
    ->   `b` varchar(64) DEFAULT NULL,
    ->   KEY `b` (`b`,`a`)
    -> ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
    -> PARTITION BY HASH( `a` )
    -> PARTITIONS 3;
Query OK, 0 rows affected (0.12 sec)

mysql> alter table t1 drop partition p2;
Query OK, 0 rows affected (0.11 sec)

mysql> select * from t1;
ERROR 2013 (HY000): Lost connection to MySQL server during query

After:

mysql> alter table t1 drop partition p2;
ERROR 1512 (HY000): DROP PARTITION can only be used on RANGE/LIST partitions

What is changed and how it works?

Forbid drop partition operation on a hash partitioned table.

Check List

Tests

  • Unit test

Related changes

  • Need to cherry-pick to the release branch

@tiancaiamao tiancaiamao added type/bug-fix This PR fixes a bug. priority/release-blocker This PR blocks a release. Please review it ASAP. component/DDL-need-LGT3 labels Jun 21, 2019
@tiancaiamao tiancaiamao added this to In Progress in Table Partitioning via automation Jun 21, 2019
@tiancaiamao
Copy link
Contributor Author

PTAL @crazycs520 @winkyao @zimulala

@tiancaiamao
Copy link
Contributor Author

/run-all-tests

Copy link
Contributor

@winkyao winkyao left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov
Copy link

codecov bot commented Jun 21, 2019

Codecov Report

Merging #10902 into master will increase coverage by 0.0208%.
The diff coverage is 100%.

@@               Coverage Diff                @@
##             master     #10902        +/-   ##
================================================
+ Coverage   81.0505%   81.0714%   +0.0208%     
================================================
  Files           419        419                
  Lines         88826      88892        +66     
================================================
+ Hits          71994      72066        +72     
+ Misses        11603      11601         -2     
+ Partials       5229       5225         -4

@tiancaiamao
Copy link
Contributor Author

/run-all-tests

@zhouqiang-cl
Copy link
Contributor

/rebuild

1 similar comment
@tiancaiamao
Copy link
Contributor Author

/rebuild

Copy link
Contributor

@crazycs520 crazycs520 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@bb7133 bb7133 left a comment

Choose a reason for hiding this comment

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

LGTM

@bb7133
Copy link
Member

bb7133 commented Jun 21, 2019

/run-unit-test

@bb7133 bb7133 merged commit 10e0086 into pingcap:master Jun 21, 2019
Table Partitioning automation moved this from In Progress to Done Jun 21, 2019
@tiancaiamao tiancaiamao deleted the drop-hash-partition branch June 21, 2019 11:06
@you06 you06 added the sig/sql-infra SIG: SQL Infra label Mar 4, 2020
@zz-jason zz-jason moved this from Issue: Done to PR: Donw in Table Partitioning Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/release-blocker This PR blocks a release. Please review it ASAP. sig/sql-infra SIG: SQL Infra type/bug-fix This PR fixes a bug.
Projects
No open projects
Table Partitioning
  
PR: Done
Development

Successfully merging this pull request may close these issues.

None yet

6 participants