Loading mysql-test/r/partition.result +12 −0 Original line number Diff line number Diff line Loading @@ -464,4 +464,16 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY (a) (PARTITION p0 ENGINE = MyISAM, PARTITION p1 ENGINE = MyISAM) drop table t1; create table t1 (a int, b int) partition by range (a) subpartition by hash(a) (partition p0 values less than (0) (subpartition sp0), partition p1 values less than (1)); ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near ')' at line 5 create table t1 (a int, b int) partition by range (a) subpartition by hash(a) (partition p0 values less than (0), partition p1 values less than (1) (subpartition sp0)); ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '))' at line 5 End of 5.1 tests mysql-test/t/partition.test +17 −0 Original line number Diff line number Diff line Loading @@ -588,4 +588,21 @@ show create table t1; drop table t1; # # BUG 15407 Crash with subpartition # --error 1064 create table t1 (a int, b int) partition by range (a) subpartition by hash(a) (partition p0 values less than (0) (subpartition sp0), partition p1 values less than (1)); --error 1064 create table t1 (a int, b int) partition by range (a) subpartition by hash(a) (partition p0 values less than (0), partition p1 values less than (1) (subpartition sp0)); --echo End of 5.1 tests sql/sql_yacc.yy +14 −1 Original line number Diff line number Diff line Loading @@ -3793,7 +3793,15 @@ part_bit_expr: ; opt_sub_partition: /* empty */ {} /* empty */ { if (Lex->part_info->no_subparts != 0 && !Lex->part_info->use_default_subpartitions) { yyerror(ER(ER_PARTITION_WRONG_NO_SUBPART_ERROR)); YYABORT; } } | '(' sub_part_list ')' { LEX *lex= Lex; Loading @@ -3809,6 +3817,11 @@ opt_sub_partition: } else if (part_info->count_curr_subparts > 0) { if (part_info->partitions.elements > 1) { yyerror(ER(ER_PARTITION_WRONG_NO_SUBPART_ERROR)); YYABORT; } part_info->no_subparts= part_info->count_curr_subparts; } part_info->count_curr_subparts= 0; Loading Loading
mysql-test/r/partition.result +12 −0 Original line number Diff line number Diff line Loading @@ -464,4 +464,16 @@ t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY (a) (PARTITION p0 ENGINE = MyISAM, PARTITION p1 ENGINE = MyISAM) drop table t1; create table t1 (a int, b int) partition by range (a) subpartition by hash(a) (partition p0 values less than (0) (subpartition sp0), partition p1 values less than (1)); ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near ')' at line 5 create table t1 (a int, b int) partition by range (a) subpartition by hash(a) (partition p0 values less than (0), partition p1 values less than (1) (subpartition sp0)); ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '))' at line 5 End of 5.1 tests
mysql-test/t/partition.test +17 −0 Original line number Diff line number Diff line Loading @@ -588,4 +588,21 @@ show create table t1; drop table t1; # # BUG 15407 Crash with subpartition # --error 1064 create table t1 (a int, b int) partition by range (a) subpartition by hash(a) (partition p0 values less than (0) (subpartition sp0), partition p1 values less than (1)); --error 1064 create table t1 (a int, b int) partition by range (a) subpartition by hash(a) (partition p0 values less than (0), partition p1 values less than (1) (subpartition sp0)); --echo End of 5.1 tests
sql/sql_yacc.yy +14 −1 Original line number Diff line number Diff line Loading @@ -3793,7 +3793,15 @@ part_bit_expr: ; opt_sub_partition: /* empty */ {} /* empty */ { if (Lex->part_info->no_subparts != 0 && !Lex->part_info->use_default_subpartitions) { yyerror(ER(ER_PARTITION_WRONG_NO_SUBPART_ERROR)); YYABORT; } } | '(' sub_part_list ')' { LEX *lex= Lex; Loading @@ -3809,6 +3817,11 @@ opt_sub_partition: } else if (part_info->count_curr_subparts > 0) { if (part_info->partitions.elements > 1) { yyerror(ER(ER_PARTITION_WRONG_NO_SUBPART_ERROR)); YYABORT; } part_info->no_subparts= part_info->count_curr_subparts; } part_info->count_curr_subparts= 0; Loading