Bug #15961 Partitions: Creation of subpart. table without subpart. rule not rejected
Submitted: 23 Dec 2005 12:13 Modified: 15 Mar 2006 9:06
Reporter: Matthias Leich Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Partitions Severity:S2 (Serious)
Version:5.1 OS:
Assigned to: Mikael Ronström CPU Architecture:Any

[23 Dec 2005 12:13] Matthias Leich
Description:
CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) ENGINE = 'MYISAM'
PARTITION BY HASH(f1) PARTITIONS 2
( PARTITION part1
(SUBPARTITION subpart11 STORAGE ENGINE = 'MYISAM',
SUBPARTITION subpart12 STORAGE ENGINE = 'MYISAM'),
PARTITION part2
(SUBPARTITION subpart21 STORAGE ENGINE = 'MYISAM',
SUBPARTITION subpart22 STORAGE ENGINE = 'MYISAM')
);
SHOW CREATE TABLE t1;
Table   Create Table
t1      CREATE TABLE `t1` (
  `f1` int(11) default NULL,
  `f2` char(20) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY HASH (f1)
(PARTITION part1  ENGINE = MyISAM, PARTITION part2  ENGINE = MyISAM)
--exec ls var/master-data/test/t1*
var/master-data/test/t1$$P$$part1.MYD
var/master-data/test/t1$$P$$part1.MYI
var/master-data/test/t1$$P$$part2.MYD
var/master-data/test/t1$$P$$part2.MYI
var/master-data/test/t1.frm
var/master-data/test/t1.par

So it looks like
1. The SHOW CREATE TABLE output is correct.
    There are no subpartition related files and this fits to the
    SHOW CREATE TABLE.
   Bug#14327 is really fixed and there is no remaining problem in printing
   existing subpartitions.
2. If the statement does not contain a subpartitioning rule, subpartitions
   will be not created.

But the CREATE TABLE should be rejected, when subpartitions without
subpartitioning rule are not supported.

My environment:
   - Intel PC with Linux(SuSE 9.3)
   - MySQL compiled from source
         bk-internal.mysql.com:/home/bk/mysql-5.1-wl2604-new
              last ChangeSet@1.1981, 2005-12-15

How to repeat:
Please execute the statements above or the test ps_02myisam,
which is pushed into the tree 
bk-internal.mysql.com:/home/bk/mysql-5.1-wl2604-new
[14 Mar 2006 8:30] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/3806
[14 Mar 2006 9:22] Mikael Ronström
Reviewed by Alexander Botchkov
[14 Mar 2006 17:49] Mikael Ronström
Didn't report error when subpartitions were defined for non-subpartitioned table
[15 Mar 2006 9:06] Jon Stephens
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Documented in 5.1.8 changelog. Closed.