From 0a48cd762a397998eecaf6f33f1b68861208be3e Mon Sep 17 00:00:00 2001 From: "mikron@mikael-ronstr-ms-dator.local" <> Date: Thu, 9 Mar 2006 18:19:34 +0100 Subject: [PATCH 01/11] BUG#17127: Crash if wrong use of VALUES for list partition --- mysql-test/r/partition.result | 24 +++++++++++++++++++++++ mysql-test/t/partition.test | 36 +++++++++++++++++++++++++++++++++++ sql/sql_partition.cc | 28 +++++++++++++++++++++++++++ sql/sql_yacc.yy | 6 ++++++ 4 files changed, 94 insertions(+) diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 59e29046d90..5123b9c3932 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -422,4 +422,28 @@ partition_name partition_description table_rows x123 11,12 1 x234 NULL,1 1 drop table t1; +create table t1 (a int) +partition by range (a) +(partition p0 values less than (1)); +alter table t1 add partition (partition p1 values in (2)); +ERROR HY000: Only LIST PARTITIONING can use VALUES IN in partition definition +alter table t1 add partition (partition p1); +ERROR HY000: RANGE PARTITIONING requires definition of VALUES LESS THAN for each partition +drop table t1; +create table t1 (a int) +partition by list (a) +(partition p0 values in (1)); +alter table t1 add partition (partition p1 values less than (2)); +ERROR HY000: Only RANGE PARTITIONING can use VALUES LESS THAN in partition definition +alter table t1 add partition (partition p1); +ERROR HY000: LIST PARTITIONING requires definition of VALUES IN for each partition +drop table t1; +create table t1 (a int) +partition by hash (a) +(partition p0); +alter table t1 add partition (partition p1 values less than (2)); +ERROR HY000: Only RANGE PARTITIONING can use VALUES LESS THAN in partition definition +alter table t1 add partition (partition p1 values in (2)); +ERROR HY000: Only LIST PARTITIONING can use VALUES IN in partition definition +drop table t1; End of 5.1 tests diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index f22edb54756..c8be4a30f6e 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -540,4 +540,40 @@ select partition_name, partition_description, table_rows from information_schema.partitions where table_schema ='test'; drop table t1; +# +# Bug 17127 +# +create table t1 (a int) +partition by range (a) +(partition p0 values less than (1)); + +--error ER_PARTITION_WRONG_VALUES_ERROR +alter table t1 add partition (partition p1 values in (2)); +--error ER_PARTITION_REQUIRES_VALUES_ERROR +alter table t1 add partition (partition p1); + +drop table t1; + +create table t1 (a int) +partition by list (a) +(partition p0 values in (1)); + +--error ER_PARTITION_WRONG_VALUES_ERROR +alter table t1 add partition (partition p1 values less than (2)); +--error ER_PARTITION_REQUIRES_VALUES_ERROR +alter table t1 add partition (partition p1); + +drop table t1; + +create table t1 (a int) +partition by hash (a) +(partition p0); + +--error ER_PARTITION_WRONG_VALUES_ERROR +alter table t1 add partition (partition p1 values less than (2)); +--error ER_PARTITION_WRONG_VALUES_ERROR +alter table t1 add partition (partition p1 values in (2)); + +drop table t1; + --echo End of 5.1 tests diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 257c1988cbd..7cb3c391e11 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -4132,6 +4132,34 @@ uint prep_alter_part_table(THD *thd, TABLE *table, ALTER_INFO *alter_info, ((flags & (HA_FAST_CHANGE_PARTITION | HA_PARTITION_ONE_PHASE)) != 0); DBUG_PRINT("info", ("*fast_alter_partition: %d flags: 0x%x", *fast_alter_partition, flags)); + if (((alter_info->flags & ALTER_ADD_PARTITION) || + (alter_info->flags & ALTER_REORGANIZE_PARTITION)) && + (thd->lex->part_info->part_type != tab_part_info->part_type)) + { + if (thd->lex->part_info->part_type == RANGE_PARTITION) + { + my_error(ER_PARTITION_WRONG_VALUES_ERROR, MYF(0), + "RANGE", "LESS THAN"); + } + else if (thd->lex->part_info->part_type == LIST_PARTITION) + { + DBUG_ASSERT(thd->lex->part_info->part_type == LIST_PARTITION); + my_error(ER_PARTITION_WRONG_VALUES_ERROR, MYF(0), + "LIST", "IN"); + } + else if (tab_part_info->part_type == RANGE_PARTITION) + { + my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0), + "RANGE", "LESS THAN"); + } + else + { + DBUG_ASSERT(tab_part_info->part_type == LIST_PARTITION); + my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0), + "LIST", "IN"); + } + DBUG_RETURN(TRUE); + } if (alter_info->flags & ALTER_ADD_PARTITION) { /* diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index a64886d503d..88ed9ff68ca 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -3734,6 +3734,8 @@ opt_part_values: YYABORT; } } + else + lex->part_info->part_type= HASH_PARTITION; } | VALUES LESS_SYM THAN_SYM part_func_max { @@ -3747,6 +3749,8 @@ opt_part_values: YYABORT; } } + else + lex->part_info->part_type= RANGE_PARTITION; } | VALUES IN_SYM '(' part_list_func ')' { @@ -3760,6 +3764,8 @@ opt_part_values: YYABORT; } } + else + lex->part_info->part_type= LIST_PARTITION; } ; From 8d3c7e3b2767412dabc15c5d661df2c2ad2a0f0c Mon Sep 17 00:00:00 2001 From: "mikael@zim.(none)" <> Date: Sat, 11 Mar 2006 05:56:06 -0800 Subject: [PATCH 02/11] BUG#16370: Default subpartitioning not properly handled in conjunction with ALTER TABLE ADD/REORGANIZE PARTITION Ensure that default subpartitioning is removed when subpartitions are defined in ADD/REORGANIZE PARTITION --- mysql-test/r/partition.result | 36 +++++++++++++++++++++++++++++++++++ mysql-test/t/partition.test | 36 +++++++++++++++++++++++++++++++++++ sql/sql_partition.cc | 9 ++++++++- 3 files changed, 80 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 80942c861fe..5a956379a47 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -428,4 +428,40 @@ partition by list (a) alter table t1 rebuild partition; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 drop table t1; +create table t1 (a int) +partition by list (a) +(partition p0 values in (5)); +insert into t1 values (0); +ERROR HY000: Table has no partition for value 0 +drop table t1; +create table t1 (a int) +partition by range (a) subpartition by hash (a) +(partition p0 values less than (100)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) SUBPARTITION BY HASH (a) (PARTITION p0 VALUES LESS THAN (100) ) +alter table t1 add partition (partition p1 values less than (200) +(subpartition subpart21)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) SUBPARTITION BY HASH (a) (PARTITION p0 VALUES LESS THAN (100) (SUBPARTITION p0sp0 ENGINE = MyISAM), PARTITION p1 VALUES LESS THAN (200) (SUBPARTITION subpart21 ENGINE = MyISAM)) +drop table t1; +create table t1 (a int) +partition by key (a); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY (a) +alter table t1 add partition (partition p1); +show create table t1; +Table Create Table +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; End of 5.1 tests diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 8fc46490856..764ef788991 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -552,4 +552,40 @@ alter table t1 rebuild partition; drop table t1; +# +# BUG 15253 Insert that should fail doesn't +# +create table t1 (a int) +partition by list (a) +(partition p0 values in (5)); + +--error ER_NO_PARTITION_FOR_GIVEN_VALUE +insert into t1 values (0); + +drop table t1; + +# +# BUG #16370 Subpartitions names not shown in SHOW CREATE TABLE output +# +create table t1 (a int) +partition by range (a) subpartition by hash (a) +(partition p0 values less than (100)); + +show create table t1; +alter table t1 add partition (partition p1 values less than (200) +(subpartition subpart21)); + +show create table t1; + +drop table t1; + +create table t1 (a int) +partition by key (a); + +show create table t1; +alter table t1 add partition (partition p1); +show create table t1; + +drop table t1; + --echo End of 5.1 tests diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 014d3616d3d..3419aee4b26 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -4069,6 +4069,7 @@ uint prep_alter_part_table(THD *thd, TABLE *table, ALTER_INFO *alter_info, ALTER_REPAIR_PARTITION | ALTER_REBUILD_PARTITION)) { partition_info *tab_part_info= table->part_info; + partition_info *alt_part_info= thd->lex->part_info; if (!tab_part_info) { my_error(ER_PARTITION_MGMT_ON_NONPARTITIONED, MYF(0)); @@ -4141,7 +4142,6 @@ uint prep_alter_part_table(THD *thd, TABLE *table, ALTER_INFO *alter_info, partitioning scheme as currently set-up. Partitions are always added at the end in ADD PARTITION. */ - partition_info *alt_part_info= thd->lex->part_info; uint no_new_partitions= alt_part_info->no_parts; uint no_orig_partitions= tab_part_info->no_parts; uint check_total_partitions= no_new_partitions + no_orig_partitions; @@ -4736,6 +4736,13 @@ the generated partition syntax in a correct manner. if (alter_info->flags == ALTER_ADD_PARTITION || alter_info->flags == ALTER_REORGANIZE_PARTITION) { + if (tab_part_info->is_sub_partitioned() && + tab_part_info->use_default_subpartitions && + !alt_part_info->use_default_subpartitions) + { + tab_part_info->use_default_subpartitions= FALSE; + tab_part_info->use_default_no_subpartitions= FALSE; + } if (check_partition_info(tab_part_info, (handlerton**)NULL, table->file, ULL(0))) { From c34c2cfa45c86df7ca4e33d4a296ccb804642b49 Mon Sep 17 00:00:00 2001 From: "mikael@zim.(none)" <> Date: Sat, 11 Mar 2006 06:17:10 -0800 Subject: [PATCH 03/11] BUG#15961: SUBPARTITION defined in non-subpartitioned table no error Made sure that no subpartition stuff in non-subpartitioned table --- mysql-test/r/partition.result | 4 ++++ mysql-test/r/partition_mgm_err.result | 4 +++- mysql-test/t/partition.test | 9 +++++++++ mysql-test/t/partition_mgm_err.test | 4 +++- sql/sql_partition.cc | 7 +++++++ 5 files changed, 26 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 80942c861fe..cdcaccbdd41 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -428,4 +428,8 @@ partition by list (a) alter table t1 rebuild partition; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 drop table t1; +create table t1 (a int) +partition by hash (a) +(partition p0 (subpartition sp0)); +ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning End of 5.1 tests diff --git a/mysql-test/r/partition_mgm_err.result b/mysql-test/r/partition_mgm_err.result index c7003c6e14c..f899801e7cd 100644 --- a/mysql-test/r/partition_mgm_err.result +++ b/mysql-test/r/partition_mgm_err.result @@ -141,7 +141,9 @@ DROP TABLE t1; CREATE TABLE t1 (a INT) PARTITION BY HASH(a); ALTER TABLE t1 ADD PARTITION PARTITIONS 4; DROP TABLE t1; -CREATE TABLE t1 (s1 int, s2 int) PARTITION BY LIST (s1) ( +CREATE TABLE t1 (s1 int, s2 int) +PARTITION BY LIST (s1) +SUBPARTITION BY KEY (s2) ( PARTITION p1 VALUES IN (0) (SUBPARTITION p1b), PARTITION p2 VALUES IN (2) (SUBPARTITION p1b) ); diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 8fc46490856..3384e2a9f0f 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -552,4 +552,13 @@ alter table t1 rebuild partition; drop table t1; +# +# BUG 15961 No error when subpartition defined without subpartition by clause +# +--error ER_SUBPARTITION_ERROR +create table t1 (a int) +partition by hash (a) +(partition p0 (subpartition sp0)); + + --echo End of 5.1 tests diff --git a/mysql-test/t/partition_mgm_err.test b/mysql-test/t/partition_mgm_err.test index f72222feadd..8573fd59f2f 100644 --- a/mysql-test/t/partition_mgm_err.test +++ b/mysql-test/t/partition_mgm_err.test @@ -205,7 +205,9 @@ DROP TABLE t1; #BUG 15408: Partitions: subpartition names are not unique # --error ER_SAME_NAME_PARTITION -CREATE TABLE t1 (s1 int, s2 int) PARTITION BY LIST (s1) ( +CREATE TABLE t1 (s1 int, s2 int) +PARTITION BY LIST (s1) +SUBPARTITION BY KEY (s2) ( PARTITION p1 VALUES IN (0) (SUBPARTITION p1b), PARTITION p2 VALUES IN (2) (SUBPARTITION p1b) ); diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 014d3616d3d..d0d600c2e81 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -692,6 +692,13 @@ bool check_partition_info(partition_info *part_info,handlerton **eng_type, char *same_name; DBUG_ENTER("check_partition_info"); + if (unlikely(!part_info->is_sub_partitioned() && + !(part_info->use_default_subpartitions && + part_info->use_default_no_subpartitions))) + { + my_error(ER_SUBPARTITION_ERROR, MYF(0)); + goto end; + } if (unlikely(part_info->is_sub_partitioned() && (!(part_info->part_type == RANGE_PARTITION || part_info->part_type == LIST_PARTITION)))) From d10a0e7e35bb5bc83b51904827ac244564d20b50 Mon Sep 17 00:00:00 2001 From: "mikael@zim.(none)" <> Date: Sat, 11 Mar 2006 06:32:24 -0800 Subject: [PATCH 04/11] Ensure we discover also error in using subpartition parts in non-subpartitioned tables in ALTER TABLE ADD/REORGANIZE PARTITION --- sql/sql_partition.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 3419aee4b26..5a6196d94fa 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -4736,8 +4736,7 @@ the generated partition syntax in a correct manner. if (alter_info->flags == ALTER_ADD_PARTITION || alter_info->flags == ALTER_REORGANIZE_PARTITION) { - if (tab_part_info->is_sub_partitioned() && - tab_part_info->use_default_subpartitions && + if (tab_part_info->use_default_subpartitions && !alt_part_info->use_default_subpartitions) { tab_part_info->use_default_subpartitions= FALSE; From 6b185a935f47bfde6d53e2ca653d322c0b13a4e1 Mon Sep 17 00:00:00 2001 From: "mikael@zim.(none)" <> Date: Mon, 13 Mar 2006 02:36:02 -0800 Subject: [PATCH 05/11] BUG#15407: Crash if error in subpartition definition --- mysql-test/r/partition.result | 12 ++++++++++++ mysql-test/t/partition.test | 17 +++++++++++++++++ sql/sql_yacc.yy | 15 ++++++++++++++- 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 5a956379a47..33f4399d581 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -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 diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 764ef788991..bb551a46ca8 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -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 diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 47852212b84..cae9bb168c4 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -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; @@ -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; From 19b66cd2b20e5d27d52760041e0596d9fc8a5246 Mon Sep 17 00:00:00 2001 From: "mikael@zim.(none)" <> Date: Mon, 13 Mar 2006 09:09:25 -0800 Subject: [PATCH 06/11] BUG #16810: Error on coalesce partition New test case (bug was already fixed) --- mysql-test/r/ndb_partition_key.result | 13 ++++++++++++ mysql-test/t/ndb_partition_key.test | 29 +++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/mysql-test/r/ndb_partition_key.result b/mysql-test/r/ndb_partition_key.result index 8842a6e1398..90ecde51e9f 100644 --- a/mysql-test/r/ndb_partition_key.result +++ b/mysql-test/r/ndb_partition_key.result @@ -89,3 +89,16 @@ ALTER TABLE t1 PARTITION BY KEY(a) (PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB); drop table t1; +CREATE TABLE t1 ( +c1 MEDIUMINT NOT NULL AUTO_INCREMENT, +c2 TEXT NOT NULL, +c3 INT NOT NULL, +c4 BIT NOT NULL, +c5 FLOAT, +c6 VARCHAR(255), +c7 TIMESTAMP, +PRIMARY KEY(c1,c3)) +ENGINE=NDB +PARTITION BY KEY(c3) PARTITIONS 5; +ALTER TABLE t1 COALESCE PARTITION 4; +DROP TABLE t1; diff --git a/mysql-test/t/ndb_partition_key.test b/mysql-test/t/ndb_partition_key.test index 7f6120fe094..22c84bf132e 100644 --- a/mysql-test/t/ndb_partition_key.test +++ b/mysql-test/t/ndb_partition_key.test @@ -79,3 +79,32 @@ PARTITION BY KEY(a) (PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB); drop table t1; + +# +# BUG 16810 Out of memory when coalesce partition +# +CREATE TABLE t1 ( + c1 MEDIUMINT NOT NULL AUTO_INCREMENT, + c2 TEXT NOT NULL, + c3 INT NOT NULL, + c4 BIT NOT NULL, + c5 FLOAT, + c6 VARCHAR(255), + c7 TIMESTAMP, + PRIMARY KEY(c1,c3)) + ENGINE=NDB + PARTITION BY KEY(c3) PARTITIONS 5; + +let $j= 11; +--disable_query_log +while ($j) +{ + eval INSERT INTO t1 VALUES (NULL, "Tested Remotely from Texas, USA", $j, +b'0', + $j.00,"By JBM $j","2006-01-26"); + dec $j; +} +--enable_query_log +ALTER TABLE t1 COALESCE PARTITION 4; + +DROP TABLE t1; From 4adb973df4eaac8cda4e94de6e44cf880cd4853c Mon Sep 17 00:00:00 2001 From: "mikael@zim.(none)" <> Date: Tue, 14 Mar 2006 00:39:06 -0800 Subject: [PATCH 07/11] BUG#15961: After review fixes New error message --- sql/share/errmsg.txt | 4 ++++ sql/sql_partition.cc | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index d163da30e95..36f96029e8a 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -5614,6 +5614,10 @@ ER_PARTITION_MAXVALUE_ERROR ER_PARTITION_SUBPARTITION_ERROR eng "Subpartitions can only be hash partitions and by key" swe "Subpartitioner kan bara vara hash och key partitioner" +ER_PARTITION_SUBPART_MIX_ERROR + eng "Must define subpartitions on all partitions if on one partition" + swe "Subpartitioner mÃ¥ste definieras pÃ¥ alla partitioner om pÃ¥ en" + ER_PARTITION_WRONG_NO_PART_ERROR eng "Wrong number of partitions defined, mismatch with previous setting" swe "Antal partitioner definierade och antal partitioner är inte lika" diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index d0d600c2e81..374bc511826 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -704,7 +704,7 @@ bool check_partition_info(partition_info *part_info,handlerton **eng_type, part_info->part_type == LIST_PARTITION)))) { /* Only RANGE and LIST partitioning can be subpartitioned */ - my_error(ER_SUBPARTITION_ERROR, MYF(0)); + my_error(ER_PARTITION_SUBPART_MIX_ERROR, MYF(0)); goto end; } if (unlikely(part_info->set_up_defaults_for_partitioning(file, From 0ec5ee2c50bc2e032d1f27a44eb61fec971a0b1b Mon Sep 17 00:00:00 2001 From: "mikael@zim.(none)" <> Date: Tue, 14 Mar 2006 01:39:27 -0800 Subject: [PATCH 08/11] Manual merge --- mysql-test/r/partition.result | 2 ++ sql/sql_partition.cc | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index add9a3474af..e0b344849a7 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -445,6 +445,8 @@ alter table t1 add partition (partition p1 values less than (2)); ERROR HY000: Only RANGE PARTITIONING can use VALUES LESS THAN in partition definition alter table t1 add partition (partition p1 values in (2)); ERROR HY000: Only LIST PARTITIONING can use VALUES IN in partition definition +drop table t1; +create table t1 (a int) partition by list (a) (partition p0 values in (1)); alter table t1 rebuild partition; diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 254c6c753e2..0d550d6e5ad 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -4135,7 +4135,8 @@ uint prep_alter_part_table(THD *thd, TABLE *table, ALTER_INFO *alter_info, *fast_alter_partition, flags)); if (((alter_info->flags & ALTER_ADD_PARTITION) || (alter_info->flags & ALTER_REORGANIZE_PARTITION)) && - (thd->lex->part_info->part_type != tab_part_info->part_type)) + (thd->lex->part_info->part_type != tab_part_info->part_type) && + (thd->lex->part_info->part_type != NOT_A_PARTITION)) { if (thd->lex->part_info->part_type == RANGE_PARTITION) { From 083e3da011ef90dc3a1e7fc0777375baac145a4b Mon Sep 17 00:00:00 2001 From: "mikael@zim.(none)" <> Date: Tue, 14 Mar 2006 03:46:12 -0800 Subject: [PATCH 09/11] Manual merge --- mysql-test/r/partition.result | 1 + mysql-test/t/partition.test | 6 +++--- sql/sql_partition.cc | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index f212036e69b..feed5483827 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -476,6 +476,7 @@ 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 +create table t1 (a int) partition by hash (a) (partition p0 (subpartition sp0)); ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 06ebabe2a23..bac8b6573e6 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -504,14 +504,14 @@ from information_schema.partitions where table_schema ='test'; drop table t1; # NULL for LIST partition ---error 1473 +--error ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR create table t1 (a int,b int, c int) partition by list(a) partitions 2 (partition x123 values in (11,12), partition x234 values in (1 ,NULL, NULL)); ---error 1473 +--error ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR create table t1 (a int,b int, c int) partition by list(a) partitions 2 @@ -523,7 +523,7 @@ partition by list(a) partitions 2 (partition x123 values in (11, 12), partition x234 values in (5, 1)); ---error 1504 +--error ER_NO_PARTITION_FOR_GIVEN_VALUE insert into t1 values (NULL,1,1); drop table t1; diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 3fae8ae3b61..18793d43016 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -704,7 +704,7 @@ bool check_partition_info(partition_info *part_info,handlerton **eng_type, part_info->part_type == LIST_PARTITION)))) { /* Only RANGE and LIST partitioning can be subpartitioned */ - my_error(ER_PARTITION_SUBPART_MIX_ERROR, MYF(0)); + my_error(ER_SUBPARTITION_ERROR, MYF(0)); goto end; } if (unlikely(part_info->set_up_defaults_for_partitioning(file, From 47029075978c3441483b17a19de58005d3c378bd Mon Sep 17 00:00:00 2001 From: "mikael@zim.(none)" <> Date: Tue, 14 Mar 2006 09:37:29 -0800 Subject: [PATCH 10/11] Fixing test cases --- mysql-test/r/backup.result | 22 +++++++++++----------- mysql-test/r/ndb_dd_ddl.result | 2 +- mysql-test/r/sp-security.result | 2 +- mysql-test/r/type_timestamp.result | 14 +++++++------- mysql-test/r/warnings.result | 2 +- mysql-test/t/log_tables.test | 8 ++++---- mysql-test/t/ndb_partition_error.test | 2 +- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/mysql-test/r/backup.result b/mysql-test/r/backup.result index 81090c17791..a65808bbdd6 100644 --- a/mysql-test/r/backup.result +++ b/mysql-test/r/backup.result @@ -6,26 +6,26 @@ Table Op Msg_type Msg_text test.t4 backup error Failed copying .frm file (errno: X) test.t4 backup status Operation failed Warnings: -Warning 1540 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead. +Warning 1541 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead. Error 1 Can't create/write to file 'MYSQLTEST_VARDIR/bogus/t4.frm' (Errcode: X) backup table t4 to '../tmp'; Table Op Msg_type Msg_text test.t4 backup status OK Warnings: -Warning 1540 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead. +Warning 1541 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead. backup table t4 to '../tmp'; Table Op Msg_type Msg_text test.t4 backup error Failed copying .frm file (errno: X) test.t4 backup status Operation failed Warnings: -Warning 1540 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead. +Warning 1541 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead. Error 1 Can't create/write to file 'MYSQLTEST_VARDIR/tmp/t4.frm' (Errcode: X) drop table t4; restore table t4 from '../tmp'; Table Op Msg_type Msg_text test.t4 restore status OK Warnings: -Warning 1540 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead. +Warning 1541 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead. select count(*) from t4; count(*) 0 @@ -35,19 +35,19 @@ backup table t1 to '../tmp'; Table Op Msg_type Msg_text test.t1 backup status OK Warnings: -Warning 1540 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead. +Warning 1541 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead. drop table t1; restore table t1 from '../bogus'; Table Op Msg_type Msg_text t1 restore error Failed copying .frm file Warnings: -Warning 1540 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead. +Warning 1541 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead. Error 29 File 'MYSQLTEST_VARDIR/bogus/t1.frm' not found (Errcode: X) restore table t1 from '../tmp'; Table Op Msg_type Msg_text test.t1 restore status OK Warnings: -Warning 1540 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead. +Warning 1541 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead. select n from t1; n 23 @@ -62,7 +62,7 @@ Table Op Msg_type Msg_text test.t2 backup status OK test.t3 backup status OK Warnings: -Warning 1540 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead. +Warning 1541 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead. drop table t1,t2,t3; restore table t1,t2,t3 from '../tmp'; Table Op Msg_type Msg_text @@ -70,7 +70,7 @@ test.t1 restore status OK test.t2 restore status OK test.t3 restore status OK Warnings: -Warning 1540 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead. +Warning 1541 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead. select n from t1; n 23 @@ -91,7 +91,7 @@ restore table t1 from '../tmp'; Table Op Msg_type Msg_text test.t1 restore status OK Warnings: -Warning 1540 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead. +Warning 1541 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead. rename table t1 to t5; lock tables t5 write; backup table t5 to '../tmp'; @@ -99,5 +99,5 @@ unlock tables; Table Op Msg_type Msg_text test.t5 backup status OK Warnings: -Warning 1540 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead. +Warning 1541 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead. drop table t5; diff --git a/mysql-test/r/ndb_dd_ddl.result b/mysql-test/r/ndb_dd_ddl.result index f406230a354..39dceef1573 100644 --- a/mysql-test/r/ndb_dd_ddl.result +++ b/mysql-test/r/ndb_dd_ddl.result @@ -16,7 +16,7 @@ ERROR HY000: Failed to create LOGFILE GROUP SHOW WARNINGS; Level Code Message Error 1296 Got error 1514 'Currently there is a limit of one logfile group' from NDB -Error 1506 Failed to create LOGFILE GROUP +Error 1507 Failed to create LOGFILE GROUP CREATE LOGFILE GROUP lg1 ADD UNDOFILE 'undofile.dat' INITIAL_SIZE 16M diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result index c8a0e40a971..a1e78cd9d7e 100644 --- a/mysql-test/r/sp-security.result +++ b/mysql-test/r/sp-security.result @@ -319,7 +319,7 @@ use db_bug7787; CREATE PROCEDURE p1() SHOW INNODB STATUS; Warnings: -Warning 1540 The syntax 'SHOW INNODB STATUS' is deprecated and will be removed in MySQL 5.2. Please use 'SHOW ENGINE INNODB STATUS' instead. +Warning 1541 The syntax 'SHOW INNODB STATUS' is deprecated and will be removed in MySQL 5.2. Please use 'SHOW ENGINE INNODB STATUS' instead. GRANT EXECUTE ON PROCEDURE p1 TO user_bug7787@localhost; DROP DATABASE db_bug7787; use test; diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result index a718ddb9a1b..95ec7526473 100644 --- a/mysql-test/r/type_timestamp.result +++ b/mysql-test/r/type_timestamp.result @@ -100,13 +100,13 @@ create table t1 (t2 timestamp(2), t4 timestamp(4), t6 timestamp(6), t8 timestamp(8), t10 timestamp(10), t12 timestamp(12), t14 timestamp(14)); Warnings: -Warning 1540 The syntax 'TIMESTAMP(2)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead. -Warning 1540 The syntax 'TIMESTAMP(4)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead. -Warning 1540 The syntax 'TIMESTAMP(6)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead. -Warning 1540 The syntax 'TIMESTAMP(8)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead. -Warning 1540 The syntax 'TIMESTAMP(10)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead. -Warning 1540 The syntax 'TIMESTAMP(12)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead. -Warning 1540 The syntax 'TIMESTAMP(14)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead. +Warning 1541 The syntax 'TIMESTAMP(2)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead. +Warning 1541 The syntax 'TIMESTAMP(4)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead. +Warning 1541 The syntax 'TIMESTAMP(6)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead. +Warning 1541 The syntax 'TIMESTAMP(8)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead. +Warning 1541 The syntax 'TIMESTAMP(10)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead. +Warning 1541 The syntax 'TIMESTAMP(12)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead. +Warning 1541 The syntax 'TIMESTAMP(14)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead. insert t1 values (0,0,0,0,0,0,0), ("1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59", diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result index 99ed14951a4..47c5dec3dd4 100644 --- a/mysql-test/r/warnings.result +++ b/mysql-test/r/warnings.result @@ -168,7 +168,7 @@ max_error_count 10 drop table t1; set table_type=MYISAM; Warnings: -Warning 1540 The syntax 'table_type' is deprecated and will be removed in MySQL 5.2. Please use 'storage_engine' instead. +Warning 1541 The syntax 'table_type' is deprecated and will be removed in MySQL 5.2. Please use 'storage_engine' instead. create table t1 (a int); insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); update t1 set a='abc'; diff --git a/mysql-test/t/log_tables.test b/mysql-test/t/log_tables.test index 8fcbb31b0d5..3b412d9e793 100644 --- a/mysql-test/t/log_tables.test +++ b/mysql-test/t/log_tables.test @@ -63,10 +63,10 @@ flush logs; # check locking of the log tables # ---error 1532 +--error 1533 lock tables mysql.general_log WRITE; ---error 1532 +--error 1533 lock tables mysql.slow_log WRITE; # @@ -75,10 +75,10 @@ lock tables mysql.slow_log WRITE; # tables are always opened and locked by the logger. # ---error 1533 +--error 1534 lock tables mysql.general_log READ; ---error 1533 +--error 1534 lock tables mysql.slow_log READ; # diff --git a/mysql-test/t/ndb_partition_error.test b/mysql-test/t/ndb_partition_error.test index b2b6017ce7b..286c2216f70 100644 --- a/mysql-test/t/ndb_partition_error.test +++ b/mysql-test/t/ndb_partition_error.test @@ -66,6 +66,6 @@ partition by list(a) partitions 2 (partition x123 values in (11, 12), partition x234 values in (5, 1)); ---error 1504 +--error 1505 insert into t1 values (NULL,1,1); drop table t1; From dd0635dc3863ec6a7b3ca3fc10707f5521e1e360 Mon Sep 17 00:00:00 2001 From: "paul@kite-hub.kitebird.com" <> Date: Tue, 14 Mar 2006 13:26:28 -0600 Subject: [PATCH 11/11] mysqld.cc: Backport option description change from 5.1 to 5.0. --- sql/mysqld.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index f1cffbfd657..a6304d4a30e 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5315,8 +5315,12 @@ log and this option does nothing anymore.", {"symbolic-links", 's', "Enable symbolic link support.", (gptr*) &my_use_symdir, (gptr*) &my_use_symdir, 0, GET_BOOL, NO_ARG, IF_PURIFY(0,1), 0, 0, 0, 0, 0}, + {"sysdate-is-now", OPT_SYSDATE_IS_NOW, + "Non-default option to alias SYSDATE() to NOW() to make it safe-replicable. Since 5.0, SYSDATE() returns a `dynamic' value different for different invocations, even within the same statement.", + (gptr*) &global_system_variables.sysdate_is_now, + 0, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0}, {"tc-heuristic-recover", OPT_TC_HEURISTIC_RECOVER, - "Decision to use in heuristic recover process. Possible values are COMMIT or ROLLBACK", + "Decision to use in heuristic recover process. Possible values are COMMIT or ROLLBACK.", (gptr*) &opt_tc_heuristic_recover, (gptr*) &opt_tc_heuristic_recover, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"temp-pool", OPT_TEMP_POOL, @@ -5936,10 +5940,6 @@ The minimum value for this variable is 4096.", (gptr*) &max_system_variables.net_wait_timeout, 0, GET_ULONG, REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, IF_WIN(INT_MAX32/1000, LONG_TIMEOUT), 0, 1, 0}, - {"sysdate-is-now", OPT_SYSDATE_IS_NOW, - "Non-default flag to alias SYSDATE() to NOW() to be safe-replicatable. Since 5.0 SYSDATE returns a `dynamic' value different for different invocation even within a query", - (gptr*) &global_system_variables.sysdate_is_now, - 0, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0}, {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} };