Bug #49050 Partitioning allows 0 partitions
Submitted: 24 Nov 2009 18:29 Modified: 26 Feb 2010 16:40
Reporter: Todd Farmer (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:5.2 r4753 OS:Windows (XP)
Assigned to: Alfredo Kojima CPU Architecture:Any

[24 Nov 2009 18:29] Todd Farmer
Description:
When using the CREATE TABLE wizard, I click on "enable partitioning" and don't change the number of partitions from zero to two (why zero exists when one does not is a mystery to me).  The resulting SQL script, naturally, fails:

ALTER TABLE `sampledata`.`quadrant_actuals`  PARTITION BY HASH() PARTITIONS 0

How to repeat:
Alter an existing table, click "enable partitioning" and "apply".

Suggested fix:
Don't allow < 2 partitions.
[25 Nov 2009 10:56] Susanne Ebrecht
There is an older bug report with the complain that you weren't able to create a single partition.

I agree that you can't have 0 partitions but 1 should be possible.

Would you be ok with not allowing < 1 partitions?
[25 Nov 2009 14:37] Todd Farmer
Yes, constraining to 1+ partitions is fine (1 isn't in my drop-down currently, but perhaps previous bug report has not been implemented yet).
[24 Feb 2010 18:18] Alfredo Kojima
Added min. limit to 1 partitions.
[25 Feb 2010 18:20] Johannes Taxacher
fix in repository confirmed
[26 Feb 2010 16:40] Tony Bedford
An entry has been added to the 5.2.17 changelog:

In the SQL editor, if Alter Table was invoked for a table, and then the partitioning tab selected and partitioning enabled, it was possible to select a partition count of 0, which then generated an error if an attempt was made to apply changes.