From 846494a48e303c9e6157068ada1af7559fed8862 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Tue, 1 Jul 2008 20:38:15 +0200 Subject: [PATCH] Bug#36732: many disabled ndb tests in test suite parts REORGANIZE TEST parts WHERE ENGINE='NDB' ;) Updated tests for better matching NDB's limitations. Removed some duplicate tests. --- .../inc/part_supported_sql_funcs_delete.inc | 3 + .../suite/parts/inc/partition_alter_11.inc | 30 +- .../suite/parts/inc/partition_bigint.inc | 11 +- mysql-test/suite/parts/inc/partition_int.inc | 10 +- .../suite/parts/inc/partition_mediumint.inc | 8 +- .../suite/parts/inc/partition_smallint.inc | 8 +- .../inc/partition_supported_sql_funcs.inc | 177 +- .../suite/parts/inc/partition_tinyint.inc | 8 +- .../suite/parts/r/ndb_blob_partition.result | 104 - .../suite/parts/r/ndb_dd_backuprestore.result | 84 +- .../suite/parts/r/ndb_partition_error.result | 47 - .../suite/parts/r/ndb_partition_key.result | 206 - .../suite/parts/r/ndb_partition_list.result | 51 - .../suite/parts/r/ndb_partition_range.result | 263 - .../r/part_supported_sql_func_ndb.result | 7269 ++++------------- .../parts/r/partition_alter1_1_innodb.result | 24 +- .../parts/r/partition_alter1_1_myisam.result | 12 +- .../parts/r/partition_alter1_2_innodb.result | 12 +- .../parts/r/partition_alter1_2_myisam.result | 4 +- .../parts/r/partition_alter2_innodb.result | 80 +- .../parts/r/partition_alter2_myisam.result | 48 +- .../suite/parts/r/partition_engine_ndb.result | 1451 +--- .../suite/parts/r/partition_int_innodb.result | 96 +- .../suite/parts/r/partition_int_myisam.result | 96 +- .../suite/parts/r/partition_int_ndb.result | 222 +- .../parts/r/rpl_ndb_dd_partitions.result | 726 -- mysql-test/suite/parts/t/disabled.def | 23 +- .../suite/parts/t/ndb_blob_partition.test | 93 - .../suite/parts/t/ndb_dd_backuprestore.test | 4 + .../suite/parts/t/ndb_partition_error.test | 71 - .../suite/parts/t/ndb_partition_key.test | 208 - .../suite/parts/t/ndb_partition_list.test | 64 - .../suite/parts/t/ndb_partition_range.test | 260 - .../parts/t/part_supported_sql_func_ndb.test | 10 +- .../parts/t/partition_alter1_1_2_ndb.test | 1 + .../suite/parts/t/partition_alter1_1_ndb.test | 1 + .../suite/parts/t/partition_alter1_2_ndb.test | 1 + .../suite/parts/t/partition_alter2_ndb.test | 5 + .../suite/parts/t/partition_basic_ndb.test | 5 + .../suite/parts/t/partition_bit_ndb.test | 9 +- .../suite/parts/t/partition_engine_ndb.test | 5 + .../suite/parts/t/partition_int_ndb.test | 11 +- .../suite/parts/t/partition_syntax_ndb.test | 5 + .../suite/parts/t/partition_value_ndb.test | 5 + .../suite/parts/t/rpl_ndb_dd_partitions.test | 310 - 45 files changed, 2299 insertions(+), 9842 deletions(-) delete mode 100644 mysql-test/suite/parts/r/ndb_blob_partition.result delete mode 100644 mysql-test/suite/parts/r/ndb_partition_error.result delete mode 100644 mysql-test/suite/parts/r/ndb_partition_key.result delete mode 100644 mysql-test/suite/parts/r/ndb_partition_list.result delete mode 100644 mysql-test/suite/parts/r/ndb_partition_range.result delete mode 100644 mysql-test/suite/parts/r/rpl_ndb_dd_partitions.result delete mode 100644 mysql-test/suite/parts/t/ndb_blob_partition.test delete mode 100644 mysql-test/suite/parts/t/ndb_partition_error.test delete mode 100644 mysql-test/suite/parts/t/ndb_partition_key.test delete mode 100644 mysql-test/suite/parts/t/ndb_partition_list.test delete mode 100644 mysql-test/suite/parts/t/ndb_partition_range.test delete mode 100644 mysql-test/suite/parts/t/rpl_ndb_dd_partitions.test diff --git a/mysql-test/suite/parts/inc/part_supported_sql_funcs_delete.inc b/mysql-test/suite/parts/inc/part_supported_sql_funcs_delete.inc index 3a486619b0b..49d0b6fc69f 100644 --- a/mysql-test/suite/parts/inc/part_supported_sql_funcs_delete.inc +++ b/mysql-test/suite/parts/inc/part_supported_sql_funcs_delete.inc @@ -43,6 +43,8 @@ eval select * from $t4 order by colint; eval select * from $t5 order by colint; eval select * from $t6 order by colint; +if (!$drop_partition_not_supported) +{ eval alter table $t1 drop partition p0; eval alter table $t2 drop partition p0; eval alter table $t4 drop partition p0; @@ -55,3 +57,4 @@ eval select * from $t3 order by col1; eval select * from $t4 order by colint; eval select * from $t5 order by colint; eval select * from $t6 order by colint; +} diff --git a/mysql-test/suite/parts/inc/partition_alter_11.inc b/mysql-test/suite/parts/inc/partition_alter_11.inc index c7dd2d1d15f..9d9800e3a1c 100644 --- a/mysql-test/suite/parts/inc/partition_alter_11.inc +++ b/mysql-test/suite/parts/inc/partition_alter_11.inc @@ -92,16 +92,13 @@ $partitioning; #----------- PARTITION BY RANGE if ($with_partitioning) { ---disable_query_log -eval SET @aux = 'PARTITION BY RANGE(f_int1) +let $partitioning= PARTITION BY RANGE(f_int1) (PARTITION parta VALUES LESS THAN (0), PARTITION partb VALUES LESS THAN ($max_row_div4), PARTITION partc VALUES LESS THAN ($max_row_div2), PARTITION partd VALUES LESS THAN ($max_row_div2 + $max_row_div4), PARTITION parte VALUES LESS THAN ($max_row), -PARTITION partf VALUES LESS THAN $MAX_VALUE)'; -let $partitioning= `SELECT @aux`; ---enable_query_log +PARTITION partf VALUES LESS THAN $MAX_VALUE); } eval CREATE TABLE t1 ( $column_list @@ -113,15 +110,11 @@ $partitioning; #----------- PARTITION BY RANGE -- SUBPARTITION BY HASH if ($with_partitioning) { ---disable_query_log -eval SET @aux = -'PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 +let $partitioning= PARTITION BY RANGE(f_int1 DIV 2) SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2 (PARTITION parta VALUES LESS THAN (0), PARTITION partb VALUES LESS THAN ($max_row_div4), PARTITION partc VALUES LESS THAN ($max_row_div2), -PARTITION partd VALUES LESS THAN $MAX_VALUE)'; -let $partitioning= `SELECT @aux`; ---enable_query_log +PARTITION partd VALUES LESS THAN $MAX_VALUE); } eval CREATE TABLE t1 ( $column_list @@ -133,8 +126,7 @@ $partitioning; #----------- PARTITION BY RANGE -- SUBPARTITION BY KEY if ($with_partitioning) { ---disable_query_log -eval SET @aux = 'PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1) +let $partitioning= PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1) (PARTITION part1 VALUES LESS THAN (0) (SUBPARTITION subpart11, SUBPARTITION subpart12), PARTITION part2 VALUES LESS THAN ($max_row_div4) @@ -142,9 +134,7 @@ PARTITION part2 VALUES LESS THAN ($max_row_div4) PARTITION part3 VALUES LESS THAN ($max_row_div2) (SUBPARTITION subpart31, SUBPARTITION subpart32), PARTITION part4 VALUES LESS THAN $MAX_VALUE -(SUBPARTITION subpart41, SUBPARTITION subpart42))'; -let $partitioning= `SELECT @aux`; ---enable_query_log +(SUBPARTITION subpart41, SUBPARTITION subpart42)); } eval CREATE TABLE t1 ( $column_list @@ -176,15 +166,11 @@ $partitioning; #----------- PARTITION BY LIST -- SUBPARTITION BY KEY if ($with_partitioning) { ---disable_query_log -eval SET @aux = -'PARTITION BY LIST(ABS(MOD(f_int1,2))) +let $partitioning= PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS $sub_part_no (PARTITION part1 VALUES IN (0), PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL))'; -let $partitioning= `SELECT @aux`; ---enable_query_log + PARTITION part3 VALUES IN (NULL)); } eval CREATE TABLE t1 ( $column_list diff --git a/mysql-test/suite/parts/inc/partition_bigint.inc b/mysql-test/suite/parts/inc/partition_bigint.inc index d3cd55096e7..307387ccce1 100644 --- a/mysql-test/suite/parts/inc/partition_bigint.inc +++ b/mysql-test/suite/parts/inc/partition_bigint.inc @@ -6,22 +6,27 @@ partition pa3 max_rows=30 min_rows=4, partition pa4 max_rows=40 min_rows=2); show create table t1; insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612), (1), (2), (65535); +--sorted_result select * from t1; select * from t1 where a=-2; delete from t1 where a=-2; +--sorted_result select * from t1; select * from t1 where a=18446744073709551615; delete from t1 where a=18446744073709551615; +--sorted_result select * from t1; drop table t1; eval create table t2 (a bigint unsigned not null, primary key(a)) engine=$engine -partition by key (a) partitions 10; +partition by key (a) partitions 8; show create table t2; insert into t2 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612); +--sorted_result select * from t2; select * from t2 where a=18446744073709551615; delete from t2 where a=18446744073709551615; +--sorted_result select * from t2; delete from t2; let $count=$maxrows; @@ -37,11 +42,13 @@ select count(*) from t2; drop table t2; eval create table t3 (a bigint not null, primary key(a)) engine=$engine -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; insert into t3 values (9223372036854775807), (9223372036854775806), (9223372036854775805), (9223372036854775804), (-9223372036854775808), (-9223372036854775807), (1), (-1), (0); +--sorted_result select * from t3; select * from t3 where a=9223372036854775806; delete from t3 where a=9223372036854775806; +--sorted_result select * from t3; drop table t3; diff --git a/mysql-test/suite/parts/inc/partition_int.inc b/mysql-test/suite/parts/inc/partition_int.inc index bd9da689187..02de94e5172 100644 --- a/mysql-test/suite/parts/inc/partition_int.inc +++ b/mysql-test/suite/parts/inc/partition_int.inc @@ -6,19 +6,23 @@ partition pa3 max_rows=30 min_rows=4, partition pa4 max_rows=40 min_rows=2); show create table t1; insert into t1 values (4294967295), (4294967294), (4294967293), (4294967292), (1), (2), (65535); +--sorted_result select * from t1; select * from t1 where a=4294967293; delete from t1 where a=4294967293; +--sorted_result select * from t1; drop table t1; eval create table t2 (a int unsigned not null, primary key(a)) engine=$engine -partition by key (a) partitions 10; +partition by key (a) partitions 8; show create table t2; insert into t2 values (4294967295), (4294967294), (4294967293), (4294967292); +--sorted_result select * from t2; select * from t2 where a=4294967293; delete from t2 where a=4294967293; +--sorted_result select * from t2; delete from t2; let $count=$maxrows; @@ -34,11 +38,13 @@ select count(*) from t2; drop table t2; eval create table t3 (a int not null, primary key(a)) engine=$engine -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; insert into t3 values (2147483647), (2147483646), (2147483645), (2147483644), (-2147483648), (-2147483647), (1), (-1), (0); +--sorted_result select * from t3; select * from t3 where a=2147483645; delete from t3 where a=2147483645; +--sorted_result select * from t3; drop table t3; diff --git a/mysql-test/suite/parts/inc/partition_mediumint.inc b/mysql-test/suite/parts/inc/partition_mediumint.inc index 10ed96e52b0..5d141bf05a4 100644 --- a/mysql-test/suite/parts/inc/partition_mediumint.inc +++ b/mysql-test/suite/parts/inc/partition_mediumint.inc @@ -6,9 +6,11 @@ partition pa3 max_rows=30 min_rows=4, partition pa4 max_rows=40 min_rows=2); show create table t1; insert into t1 values (16777215), (16777214), (16777213), (16777212), (1), (2), (65535); +--sorted_result select * from t1; select * from t1 where a=16777213; delete from t1 where a=16777213; +--sorted_result select * from t1; drop table t1; @@ -16,9 +18,11 @@ eval create table t2 (a mediumint unsigned not null, primary key(a)) engine=$eng partition by key (a) partitions 8; show create table t2; insert into t2 values (16777215), (16777214), (16777213), (16777212); +--sorted_result select * from t2; select * from t2 where a=16777213; delete from t2 where a=16777213; +--sorted_result select * from t2; delete from t2; let $count=$maxrows; @@ -34,11 +38,13 @@ select count(*) from t2; drop table t2; eval create table t3 (a mediumint not null, primary key(a)) engine=$engine -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; insert into t3 values (8388607), (8388606), (8388605), (8388604), (-8388608), (-8388607), (1), (-1), (0); +--sorted_result select * from t3; select * from t3 where a=8388605; delete from t3 where a=8388605; +--sorted_result select * from t3; drop table t3; diff --git a/mysql-test/suite/parts/inc/partition_smallint.inc b/mysql-test/suite/parts/inc/partition_smallint.inc index 8e5e93f079b..f1a70c337c2 100644 --- a/mysql-test/suite/parts/inc/partition_smallint.inc +++ b/mysql-test/suite/parts/inc/partition_smallint.inc @@ -6,9 +6,11 @@ partition pa3 max_rows=30 min_rows=4, partition pa4 max_rows=40 min_rows=2); show create table t1; insert into t1 values (65535), (65534), (65533), (65532), (1), (2), (256); +--sorted_result select * from t1; select * from t1 where a=65533; delete from t1 where a=65533; +--sorted_result select * from t1; drop table t1; @@ -16,9 +18,11 @@ eval create table t2 (a smallint unsigned not null, primary key(a)) engine=$engi partition by key (a) partitions 8; show create table t2; insert into t2 values (65535), (65534), (65533), (65532); +--sorted_result select * from t2; select * from t2 where a=65533; delete from t2 where a=65533; +--sorted_result select * from t2; delete from t2; let $count=$maxrows; @@ -34,11 +38,13 @@ select count(*) from t2; drop table t2; eval create table t3 (a smallint not null, primary key(a)) engine=$engine -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; insert into t3 values (32767), (32766), (32765), (32764), (-32768), (-32767), (1), (-1), (0); +--sorted_result select * from t3; select * from t3 where a=32765; delete from t3 where a=32765; +--sorted_result select * from t3; drop table t3; diff --git a/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc b/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc index d9c1f5836f0..6e7b15c606b 100644 --- a/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc +++ b/mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc @@ -1,5 +1,6 @@ ################################################################################ -# t/partition_supported_sql_funcs.inc # # # +# t/partition_supported_sql_funcs.inc # +# # # Purpose: # # Tests frame for allowed sql functions # # # @@ -7,9 +8,10 @@ #------------------------------------------------------------------------------# # Original Author: HH # # Original Date: 2006-11-22 # -# Change Author: # -# Change Date: # -# Change: # +# Change Author: MattiasJ # +# Change Date: 2008-05-15 # +# Change: Added $max_8_partitions since ndb only capable of 8 partitions # +# and $no_reorg_partition since ndb does not support that # ################################################################################ --echo ------------------------------------------------------------------------- --echo --- $sqlfunc in partition with coltype $coltype @@ -25,16 +27,11 @@ drop table if exists t6 ; --enable_warnings --enable_abort_on_error ---echo ------------------------------------------------------------------------- ---echo --- Create tables with $sqlfunc ---echo ------------------------------------------------------------------------- -eval create table t1 (col1 $coltype) engine=$engine -partition by range($sqlfunc) +let $part_t1= partition by range($sqlfunc) (partition p0 values less than (15), partition p1 values less than maxvalue); -eval create table t2 (col1 $coltype) engine=$engine -partition by list($sqlfunc) +let $part_t2= partition by list($sqlfunc) (partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30), @@ -43,17 +40,14 @@ partition by list($sqlfunc) partition p5 values in (51,52,53,54,55,56,57,58,59,60) ); -eval create table t3 (col1 $coltype) engine=$engine -partition by hash($sqlfunc); +let $part_t3= partition by hash($sqlfunc); -eval create table t4 (colint int, col1 $coltype) engine=$engine -partition by range(colint) +let $part_t4= partition by range(colint) subpartition by hash($sqlfunc) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); -eval create table t5 (colint int, col1 $coltype) engine=$engine -partition by list(colint) +let $part_t5= partition by list(colint) subpartition by hash($sqlfunc) subpartitions 2 (partition p0 values in (1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), @@ -62,12 +56,59 @@ subpartition by hash($sqlfunc) subpartitions 2 partition p4 values in (41,42,43,44,45,46,47,48,49,50), partition p5 values in (51,52,53,54,55,56,57,58,59,60) ); +if ($max_8_partitions) +{ +let $part_t5= partition by list(colint) +subpartition by hash($sqlfunc) subpartitions 2 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), + partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), + partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), + partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) +); +} -eval create table t6 (colint int, col1 $coltype) engine=$engine -partition by range(colint) +let $part_t6= partition by range(colint) (partition p0 values less than ($valsqlfunc), partition p1 values less than maxvalue); +let $part_t55_altered= partition by list(colint) +subpartition by hash($sqlfunc) subpartitions 5 +(partition p0 values in (1,2,3,4,5,6,7,8,9,10), + partition p1 values in (11,12,13,14,15,16,17,18,19,20), + partition p2 values in (21,22,23,24,25,26,27,28,29,30), + partition p3 values in (31,32,33,34,35,36,37,38,39,40), + partition p4 values in (41,42,43,44,45,46,47,48,49,50), + partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +if ($max_8_partitions) +{ +let $part_t55_altered= partition by list(colint) +subpartition by hash($sqlfunc) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), + partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) +); +} +--echo ------------------------------------------------------------------------- +--echo --- Create tables with $sqlfunc +--echo ------------------------------------------------------------------------- +eval create table t1 (col1 $coltype) engine=$engine +$part_t1; + +eval create table t2 (col1 $coltype) engine=$engine +$part_t2; + +eval create table t3 (col1 $coltype) engine=$engine +$part_t3; + +eval create table t4 (colint int, col1 $coltype) engine=$engine +$part_t4; + +eval create table t5 (colint int, col1 $coltype) engine=$engine +$part_t5; + +eval create table t6 (colint int, col1 $coltype) engine=$engine +$part_t6; + --echo ------------------------------------------------------------------------- --echo --- Access tables with $sqlfunc --echo ------------------------------------------------------------------------- @@ -135,39 +176,17 @@ eval create table t44 engine=$engine as select * from t4; eval create table t55 engine=$engine as select * from t5; eval create table t66 engine=$engine as select * from t6; eval alter table t11 -partition by range($sqlfunc) -(partition p0 values less than (15), - partition p1 values less than maxvalue); +$part_t1; eval alter table t22 -partition by list($sqlfunc) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), - partition p1 values in (11,12,13,14,15,16,17,18,19,20), - partition p2 values in (21,22,23,24,25,26,27,28,29,30), - partition p3 values in (31,32,33,34,35,36,37,38,39,40), - partition p4 values in (41,42,43,44,45,46,47,48,49,50), - partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); +$part_t2; eval alter table t33 -partition by hash($sqlfunc); +$part_t3; eval alter table t44 -partition by range(colint) -subpartition by hash($sqlfunc) subpartitions 2 -(partition p0 values less than (15), - partition p1 values less than maxvalue); +$part_t4; eval alter table t55 -partition by list(colint) -subpartition by hash($sqlfunc) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), - partition p1 values in (11,12,13,14,15,16,17,18,19,20), - partition p2 values in (21,22,23,24,25,26,27,28,29,30), - partition p3 values in (31,32,33,34,35,36,37,38,39,40), - partition p4 values in (41,42,43,44,45,46,47,48,49,50), - partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); +$part_t5; eval alter table t66 -partition by range(colint) -(partition p0 values less than ($valsqlfunc), - partition p1 values less than maxvalue); +$part_t6; select * from t11 order by col1; select * from t22 order by col1; @@ -181,51 +200,49 @@ if ($do_long_tests) --echo --------------------------- --echo ---- some alter table begin --echo --------------------------- - eval alter table t11 - reorganize partition p0,p1 into - (partition s1 values less than maxvalue); - select * from t11 order by col1; + if (!$no_reorg_partition) + { + eval alter table t11 + reorganize partition p0,p1 into + (partition s1 values less than maxvalue); + select * from t11 order by col1; - eval alter table t11 - reorganize partition s1 into - (partition p0 values less than (15), - partition p1 values less than maxvalue); - select * from t11 order by col1; + eval alter table t11 + reorganize partition s1 into + (partition p0 values less than (15), + partition p1 values less than maxvalue); + select * from t11 order by col1; + } eval alter table t55 -partition by list(colint) -subpartition by hash($sqlfunc) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), - partition p1 values in (11,12,13,14,15,16,17,18,19,20), - partition p2 values in (21,22,23,24,25,26,27,28,29,30), - partition p3 values in (31,32,33,34,35,36,37,38,39,40), - partition p4 values in (41,42,43,44,45,46,47,48,49,50), - partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); +$part_t55_altered; show create table t55; select * from t55 order by colint; - eval alter table t66 - reorganize partition p0,p1 into - (partition s1 values less than maxvalue); - select * from t66 order by colint; - - eval alter table t66 - reorganize partition s1 into - (partition p0 values less than ($valsqlfunc), - partition p1 values less than maxvalue); - select * from t66 order by colint; - - eval alter table t66 + if (!$no_reorg_partition) + { + eval alter table t66 reorganize partition p0,p1 into (partition s1 values less than maxvalue); select * from t66 order by colint; - eval alter table t66 + eval alter table t66 reorganize partition s1 into - (partition p0 values less than ($valsqlfunc), - partition p1 values less than maxvalue); + (partition p0 values less than ($valsqlfunc), + partition p1 values less than maxvalue); select * from t66 order by colint; + + eval alter table t66 + reorganize partition p0,p1 into + (partition s1 values less than maxvalue); + select * from t66 order by colint; + + eval alter table t66 + reorganize partition s1 into + (partition p0 values less than ($valsqlfunc), + partition p1 values less than maxvalue); + select * from t66 order by colint; + } let $t1=t1; let $t2=t2; diff --git a/mysql-test/suite/parts/inc/partition_tinyint.inc b/mysql-test/suite/parts/inc/partition_tinyint.inc index 00568eec244..9954a00e819 100644 --- a/mysql-test/suite/parts/inc/partition_tinyint.inc +++ b/mysql-test/suite/parts/inc/partition_tinyint.inc @@ -6,9 +6,11 @@ partition pa3 max_rows=30 min_rows=4, partition pa4 max_rows=40 min_rows=2); show create table t1; insert into t1 values (255), (254), (253), (252), (1), (2), (128); +--sorted_result select * from t1; select * from t1 where a=253; delete from t1 where a=253; +--sorted_result select * from t1; drop table t1; @@ -16,9 +18,11 @@ eval create table t2 (a tinyint unsigned not null, primary key(a)) engine=$engin partition by key (a) partitions 8; show create table t2; insert into t2 values (255), (254), (253), (252); +--sorted_result select * from t2; select * from t2 where a=253; delete from t2 where a=253; +--sorted_result select * from t2; delete from t2; let $count=255; @@ -34,11 +38,13 @@ select count(*) from t2; drop table t2; eval create table t3 (a tinyint not null, primary key(a)) engine=$engine -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; insert into t3 values (127), (126), (125), (124), (-128), (-127), (1), (-1), (0); +--sorted_result select * from t3; select * from t3 where a=125; delete from t3 where a=125; +--sorted_result select * from t3; drop table t3; diff --git a/mysql-test/suite/parts/r/ndb_blob_partition.result b/mysql-test/suite/parts/r/ndb_blob_partition.result deleted file mode 100644 index b08a91f0cdd..00000000000 --- a/mysql-test/suite/parts/r/ndb_blob_partition.result +++ /dev/null @@ -1,104 +0,0 @@ -drop table if exists t1; -create table t1 ( -a mediumint not null, -b text not null, -c int not null, -d longblob, -primary key using hash (a,c), -unique key (c) -) -engine=ndb -partition by range (c) -partitions 3 -( partition p1 values less than (200), -partition p2 values less than (300), -partition p3 values less than (400)); -insert into t1 values (1, @v1, 101, @v2); -insert into t1 values (1, @v2, 102, @v3); -insert into t1 values (1, @v3, 103, @v4); -insert into t1 values (2, @v4, 201, @v5); -insert into t1 values (2, @v5, 202, @v6); -insert into t1 values (2, @v6, 203, @v7); -insert into t1 values (3, @v7, 301, @v8); -insert into t1 values (3, @v8, 302, @v9); -insert into t1 values (3, @v9, 303, @v1); -select a, sha1(b), c, sha1(d) from t1 order by a; -a sha1(b) c sha1(d) -1 1d42dd9090cf78314a06665d4ea938c35cc760f4 101 10d3c783026b310218d10b7188da96a2401648c6 -1 10d3c783026b310218d10b7188da96a2401648c6 102 a33549d9844092289a58ac348dd59f09fc28406a -1 a33549d9844092289a58ac348dd59f09fc28406a 103 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c -2 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 201 70fc9a7d08beebc522258bfb02000a30c77a8f1d -2 70fc9a7d08beebc522258bfb02000a30c77a8f1d 202 090565c580809efed3d369481a4bbb168b20713e -2 090565c580809efed3d369481a4bbb168b20713e 203 1e0070bec426871a46291de27b9bd6e4255ab4e5 -3 1e0070bec426871a46291de27b9bd6e4255ab4e5 301 acbaba01bc2e682f015f40e79d9cbe475db3002e -3 acbaba01bc2e682f015f40e79d9cbe475db3002e 302 9ee30d99162574f79c66ae95cdf132dcf9cbc259 -3 9ee30d99162574f79c66ae95cdf132dcf9cbc259 303 1d42dd9090cf78314a06665d4ea938c35cc760f4 -select a, sha1(b), c, sha1(d) from t1 where a = 1 and c = 101; -a sha1(b) c sha1(d) -1 1d42dd9090cf78314a06665d4ea938c35cc760f4 101 10d3c783026b310218d10b7188da96a2401648c6 -select a, sha1(b), c, sha1(d) from t1 where a = 2 and c = 201; -a sha1(b) c sha1(d) -2 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 201 70fc9a7d08beebc522258bfb02000a30c77a8f1d -select a, sha1(b), c, sha1(d) from t1 where a = 3 and c = 301; -a sha1(b) c sha1(d) -3 1e0070bec426871a46291de27b9bd6e4255ab4e5 301 acbaba01bc2e682f015f40e79d9cbe475db3002e -update t1 set b = @v3, d = @v4 where a = 1 and c = 102; -update t1 set b = @v6, d = @v7 where a = 2 and c = 202; -update t1 set b = @v9, d = @v1 where a = 3 and c = 302; -select a, sha1(b), c, sha1(d) from t1 order by a; -a sha1(b) c sha1(d) -1 1d42dd9090cf78314a06665d4ea938c35cc760f4 101 10d3c783026b310218d10b7188da96a2401648c6 -1 a33549d9844092289a58ac348dd59f09fc28406a 102 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c -1 a33549d9844092289a58ac348dd59f09fc28406a 103 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c -2 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 201 70fc9a7d08beebc522258bfb02000a30c77a8f1d -2 090565c580809efed3d369481a4bbb168b20713e 202 1e0070bec426871a46291de27b9bd6e4255ab4e5 -2 090565c580809efed3d369481a4bbb168b20713e 203 1e0070bec426871a46291de27b9bd6e4255ab4e5 -3 1e0070bec426871a46291de27b9bd6e4255ab4e5 301 acbaba01bc2e682f015f40e79d9cbe475db3002e -3 9ee30d99162574f79c66ae95cdf132dcf9cbc259 302 1d42dd9090cf78314a06665d4ea938c35cc760f4 -3 9ee30d99162574f79c66ae95cdf132dcf9cbc259 303 1d42dd9090cf78314a06665d4ea938c35cc760f4 -update t1 set b = @v4, d = @v5 where c = 103; -update t1 set b = @v7, d = @v8 where c = 203; -update t1 set b = @v1, d = @v2 where c = 303; -select a, sha1(b), c, sha1(d) from t1 order by a; -a sha1(b) c sha1(d) -1 1d42dd9090cf78314a06665d4ea938c35cc760f4 101 10d3c783026b310218d10b7188da96a2401648c6 -1 a33549d9844092289a58ac348dd59f09fc28406a 102 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c -1 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 103 70fc9a7d08beebc522258bfb02000a30c77a8f1d -2 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 201 70fc9a7d08beebc522258bfb02000a30c77a8f1d -2 090565c580809efed3d369481a4bbb168b20713e 202 1e0070bec426871a46291de27b9bd6e4255ab4e5 -2 1e0070bec426871a46291de27b9bd6e4255ab4e5 203 acbaba01bc2e682f015f40e79d9cbe475db3002e -3 1e0070bec426871a46291de27b9bd6e4255ab4e5 301 acbaba01bc2e682f015f40e79d9cbe475db3002e -3 9ee30d99162574f79c66ae95cdf132dcf9cbc259 302 1d42dd9090cf78314a06665d4ea938c35cc760f4 -3 1d42dd9090cf78314a06665d4ea938c35cc760f4 303 10d3c783026b310218d10b7188da96a2401648c6 -update t1 set b = @v5, d = @v6; -select a, sha1(b), c, sha1(d) from t1 order by a; -a sha1(b) c sha1(d) -1 70fc9a7d08beebc522258bfb02000a30c77a8f1d 101 090565c580809efed3d369481a4bbb168b20713e -1 70fc9a7d08beebc522258bfb02000a30c77a8f1d 102 090565c580809efed3d369481a4bbb168b20713e -1 70fc9a7d08beebc522258bfb02000a30c77a8f1d 103 090565c580809efed3d369481a4bbb168b20713e -2 70fc9a7d08beebc522258bfb02000a30c77a8f1d 201 090565c580809efed3d369481a4bbb168b20713e -2 70fc9a7d08beebc522258bfb02000a30c77a8f1d 202 090565c580809efed3d369481a4bbb168b20713e -2 70fc9a7d08beebc522258bfb02000a30c77a8f1d 203 090565c580809efed3d369481a4bbb168b20713e -3 70fc9a7d08beebc522258bfb02000a30c77a8f1d 301 090565c580809efed3d369481a4bbb168b20713e -3 70fc9a7d08beebc522258bfb02000a30c77a8f1d 302 090565c580809efed3d369481a4bbb168b20713e -3 70fc9a7d08beebc522258bfb02000a30c77a8f1d 303 090565c580809efed3d369481a4bbb168b20713e -update t1 set b = @v1, d = @v2 where 100 < c and c < 200; -update t1 set b = @v4, d = @v5 where 200 < c and c < 300; -update t1 set b = @v7, d = @v8 where 300 < c and c < 400; -select a, sha1(b), c, sha1(d) from t1 order by a; -a sha1(b) c sha1(d) -1 1d42dd9090cf78314a06665d4ea938c35cc760f4 101 10d3c783026b310218d10b7188da96a2401648c6 -1 1d42dd9090cf78314a06665d4ea938c35cc760f4 102 10d3c783026b310218d10b7188da96a2401648c6 -1 1d42dd9090cf78314a06665d4ea938c35cc760f4 103 10d3c783026b310218d10b7188da96a2401648c6 -2 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 201 70fc9a7d08beebc522258bfb02000a30c77a8f1d -2 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 202 70fc9a7d08beebc522258bfb02000a30c77a8f1d -2 daa61c6de36a0526f0d47dc29d6b9de7e6d2630c 203 70fc9a7d08beebc522258bfb02000a30c77a8f1d -3 1e0070bec426871a46291de27b9bd6e4255ab4e5 301 acbaba01bc2e682f015f40e79d9cbe475db3002e -3 1e0070bec426871a46291de27b9bd6e4255ab4e5 302 acbaba01bc2e682f015f40e79d9cbe475db3002e -3 1e0070bec426871a46291de27b9bd6e4255ab4e5 303 acbaba01bc2e682f015f40e79d9cbe475db3002e -delete from t1 where a = 1 and c = 101; -delete from t1 where c = 102; -delete from t1; -select a, sha1(b), c, sha1(d) from t1 order by a; -a sha1(b) c sha1(d) -drop table t1; diff --git a/mysql-test/suite/parts/r/ndb_dd_backuprestore.result b/mysql-test/suite/parts/r/ndb_dd_backuprestore.result index e7568e4ce49..c82fe560121 100644 --- a/mysql-test/suite/parts/r/ndb_dd_backuprestore.result +++ b/mysql-test/suite/parts/r/ndb_dd_backuprestore.result @@ -175,7 +175,7 @@ t1 CREATE TABLE `t1` ( `c3` int(11) NOT NULL, `c4` bit(1) NOT NULL, PRIMARY KEY (`pk1`,`c3`) -) TABLESPACE table_space1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (c3) PARTITIONS 4 +) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 4 */ SHOW CREATE TABLE test.t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -184,7 +184,7 @@ t2 CREATE TABLE `t2` ( `c3` int(11) NOT NULL, `c4` bit(1) NOT NULL, PRIMARY KEY (`pk1`,`c3`) -) TABLESPACE table_space2 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) +) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ SHOW CREATE TABLE test.t3; Table Create Table t3 CREATE TABLE `t3` ( @@ -193,7 +193,7 @@ t3 CREATE TABLE `t3` ( `c3` int(11) NOT NULL, `c4` bit(1) NOT NULL, PRIMARY KEY (`pk1`,`c3`) -) TABLESPACE table_space2 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) +) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */ SHOW CREATE TABLE test.t4; Table Create Table t4 CREATE TABLE `t4` ( @@ -202,7 +202,7 @@ t4 CREATE TABLE `t4` ( `c3` int(11) NOT NULL, `c4` bit(1) NOT NULL, PRIMARY KEY (`pk1`,`c3`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (c3) PARTITIONS 2 +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 2 */ SHOW CREATE TABLE test.t5; Table Create Table t5 CREATE TABLE `t5` ( @@ -211,7 +211,7 @@ t5 CREATE TABLE `t5` ( `c3` int(11) NOT NULL, `c4` bit(1) NOT NULL, PRIMARY KEY (`pk1`,`c3`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY (pk1) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (pk1) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ SHOW CREATE TABLE test.t6; Table Create Table t6 CREATE TABLE `t6` ( @@ -220,34 +220,34 @@ t6 CREATE TABLE `t6` ( `c3` int(11) NOT NULL, `c4` bit(1) NOT NULL, PRIMARY KEY (`pk1`,`c3`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (pk1) (PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (pk1) (PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) */ SELECT * FROM information_schema.partitions WHERE table_name= 't1'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -NULL test t1 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t1 p1 NULL 2 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t1 p2 NULL 3 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t1 p3 NULL 4 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default +NULL test t1 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1 +NULL test t1 p1 NULL 2 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1 +NULL test t1 p2 NULL 3 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1 +NULL test t1 p3 NULL 4 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1 SELECT * FROM information_schema.partitions WHERE table_name= 't2'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -NULL test t2 p0 NULL 1 NULL KEY NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t2 p1 NULL 2 NULL KEY NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default +NULL test t2 p0 NULL 1 NULL KEY NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2 +NULL test t2 p1 NULL 2 NULL KEY NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2 SELECT * FROM information_schema.partitions WHERE table_name= 't3'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -NULL test t3 x1 NULL 1 NULL RANGE NULL c3 NULL 105 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t3 x2 NULL 2 NULL RANGE NULL c3 NULL 333 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t3 x3 NULL 3 NULL RANGE NULL c3 NULL 720 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default +NULL test t3 x1 NULL 1 NULL RANGE NULL c3 NULL 105 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2 +NULL test t3 x2 NULL 2 NULL RANGE NULL c3 NULL 333 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2 +NULL test t3 x3 NULL 3 NULL RANGE NULL c3 NULL 720 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2 SELECT * FROM information_schema.partitions WHERE table_name= 't4'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -NULL test t4 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t4 p1 NULL 2 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default +NULL test t4 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL +NULL test t4 p1 NULL 2 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL SELECT * FROM information_schema.partitions WHERE table_name= 't5'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -NULL test t5 p0 NULL 1 NULL KEY NULL pk1 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t5 p1 NULL 2 NULL KEY NULL pk1 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default +NULL test t5 p0 NULL 1 NULL KEY NULL pk1 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL +NULL test t5 p1 NULL 2 NULL KEY NULL pk1 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL SELECT * FROM information_schema.partitions WHERE table_name= 't6'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -NULL test t6 x1 NULL 1 NULL RANGE NULL pk1 NULL 333 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t6 x2 NULL 2 NULL RANGE NULL pk1 NULL 720 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default +NULL test t6 x1 NULL 1 NULL RANGE NULL pk1 NULL 333 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL +NULL test t6 x2 NULL 2 NULL RANGE NULL pk1 NULL 720 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL SELECT COUNT(*) FROM test.t1; COUNT(*) 250 @@ -341,7 +341,7 @@ t1 CREATE TABLE `t1` ( `c3` int(11) NOT NULL, `c4` bit(1) NOT NULL, PRIMARY KEY (`pk1`,`c3`) -) TABLESPACE table_space1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (c3) PARTITIONS 4 +) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 4 */ SHOW CREATE TABLE test.t2; Table Create Table t2 CREATE TABLE `t2` ( @@ -350,7 +350,7 @@ t2 CREATE TABLE `t2` ( `c3` int(11) NOT NULL, `c4` bit(1) NOT NULL, PRIMARY KEY (`pk1`,`c3`) -) TABLESPACE table_space2 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) +) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ SHOW CREATE TABLE test.t3; Table Create Table t3 CREATE TABLE `t3` ( @@ -359,7 +359,7 @@ t3 CREATE TABLE `t3` ( `c3` int(11) NOT NULL, `c4` bit(1) NOT NULL, PRIMARY KEY (`pk1`,`c3`) -) TABLESPACE table_space2 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) +) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */ SHOW CREATE TABLE test.t4; Table Create Table t4 CREATE TABLE `t4` ( @@ -368,7 +368,7 @@ t4 CREATE TABLE `t4` ( `c3` int(11) NOT NULL, `c4` bit(1) NOT NULL, PRIMARY KEY (`pk1`,`c3`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (c3) PARTITIONS 2 +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 2 */ SHOW CREATE TABLE test.t5; Table Create Table t5 CREATE TABLE `t5` ( @@ -377,7 +377,7 @@ t5 CREATE TABLE `t5` ( `c3` int(11) NOT NULL, `c4` bit(1) NOT NULL, PRIMARY KEY (`pk1`,`c3`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY (pk1) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (pk1) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ SHOW CREATE TABLE test.t6; Table Create Table t6 CREATE TABLE `t6` ( @@ -386,34 +386,34 @@ t6 CREATE TABLE `t6` ( `c3` int(11) NOT NULL, `c4` bit(1) NOT NULL, PRIMARY KEY (`pk1`,`c3`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (pk1) (PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (pk1) (PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) */ SELECT * FROM information_schema.partitions WHERE table_name= 't1'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -NULL test t1 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t1 p1 NULL 2 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t1 p2 NULL 3 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t1 p3 NULL 4 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default +NULL test t1 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1 +NULL test t1 p1 NULL 2 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1 +NULL test t1 p2 NULL 3 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1 +NULL test t1 p3 NULL 4 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1 SELECT * FROM information_schema.partitions WHERE table_name= 't2'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -NULL test t2 p0 NULL 1 NULL KEY NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t2 p1 NULL 2 NULL KEY NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default +NULL test t2 p0 NULL 1 NULL KEY NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2 +NULL test t2 p1 NULL 2 NULL KEY NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2 SELECT * FROM information_schema.partitions WHERE table_name= 't3'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -NULL test t3 x1 NULL 1 NULL RANGE NULL c3 NULL 105 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t3 x2 NULL 2 NULL RANGE NULL c3 NULL 333 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t3 x3 NULL 3 NULL RANGE NULL c3 NULL 720 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default +NULL test t3 x1 NULL 1 NULL RANGE NULL c3 NULL 105 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2 +NULL test t3 x2 NULL 2 NULL RANGE NULL c3 NULL 333 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2 +NULL test t3 x3 NULL 3 NULL RANGE NULL c3 NULL 720 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space2 SELECT * FROM information_schema.partitions WHERE table_name= 't4'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -NULL test t4 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t4 p1 NULL 2 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default +NULL test t4 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL +NULL test t4 p1 NULL 2 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL SELECT * FROM information_schema.partitions WHERE table_name= 't5'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -NULL test t5 p0 NULL 1 NULL KEY NULL pk1 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t5 p1 NULL 2 NULL KEY NULL pk1 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default +NULL test t5 p0 NULL 1 NULL KEY NULL pk1 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL +NULL test t5 p1 NULL 2 NULL KEY NULL pk1 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL SELECT * FROM information_schema.partitions WHERE table_name= 't6'; TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -NULL test t6 x1 NULL 1 NULL RANGE NULL pk1 NULL 333 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default -NULL test t6 x2 NULL 2 NULL RANGE NULL pk1 NULL 720 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default +NULL test t6 x1 NULL 1 NULL RANGE NULL pk1 NULL 333 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL +NULL test t6 x2 NULL 2 NULL RANGE NULL pk1 NULL 720 0 0 0 NULL 0 0 NULL NULL NULL NULL default NULL SELECT COUNT(*) FROM test.t1; COUNT(*) 250 diff --git a/mysql-test/suite/parts/r/ndb_partition_error.result b/mysql-test/suite/parts/r/ndb_partition_error.result deleted file mode 100644 index d86dc382185..00000000000 --- a/mysql-test/suite/parts/r/ndb_partition_error.result +++ /dev/null @@ -1,47 +0,0 @@ -drop table if exists t1; -CREATE TABLE t1 ( -a int not null, -b int not null, -c int not null, -primary key(a,b), -index (a)) -engine = ndb -partition by range (a) -partitions 3 -(partition x1 values less than (5) nodegroup 12, -partition x2 values less than (10) nodegroup 13, -partition x3 values less than (20) nodegroup 14); -ERROR HY000: Can't create table 'test.t1' (errno: 140) -show warnings; -Level Code Message -Error 1296 Got error 771 'Given NODEGROUP doesn't exist in this cluster' from NDB -Error 1005 Can't create table 'test.t1' (errno: 140) -CREATE TABLE t1 ( -a int not null, -b int not null, -c int not null, -primary key(a)) -engine = ndb -partition by range (a) -partitions 3 -(partition x1 values less than (5), -partition x2 values less than (10), -partition x3 values less than (20)); -drop table t1; -CREATE TABLE t1 (id INT) ENGINE=NDB -PARTITION BY LIST(id) -(PARTITION p0 VALUES IN (2, 4), -PARTITION p1 VALUES IN (42, 142)); -INSERT INTO t1 VALUES (2); -UPDATE t1 SET id=5 WHERE id=2; -ERROR HY000: Table has no partition for value 5 -DROP TABLE t1; -create table t1 (a int,b int, c int) -engine = ndb -partition by list(a) -partitions 2 -(partition x123 values in (11, 12), -partition x234 values in (5, 1)); -insert into t1 values (NULL,1,1); -ERROR HY000: Table has no partition for value NULL -drop table t1; diff --git a/mysql-test/suite/parts/r/ndb_partition_key.result b/mysql-test/suite/parts/r/ndb_partition_key.result deleted file mode 100644 index 00565a3979d..00000000000 --- a/mysql-test/suite/parts/r/ndb_partition_key.result +++ /dev/null @@ -1,206 +0,0 @@ -DROP TABLE IF EXISTS t1; -CREATE TABLE t1 (a int, b int, c int, d int, PRIMARY KEY(a,b,c)) -ENGINE = NDB -PARTITION BY KEY (a,b); -insert into t1 values (1,1,1,1); -select * from t1; -a b c d -1 1 1 1 -update t1 set d = 2 where a = 1 and b = 1 and c = 1; -select * from t1; -a b c d -1 1 1 2 -delete from t1; -select * from t1; -a b c d -drop table t1; -CREATE TABLE t1 (a int, b int, c int, d int, PRIMARY KEY(a,b)) -ENGINE = NDB -PARTITION BY KEY (c); -ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function -CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY(a,b)) -ENGINE = NDB -PARTITION BY KEY (a); -insert into t1 values -(1,1,3),(1,2,3),(1,3,3),(1,4,3),(1,5,3),(1,6,3), -(1,7,3),(1,8,3),(1,9,3),(1,10,3),(1,11,3),(1,12,3); -select * from t1 order by b; -a b c -1 1 3 -1 2 3 -1 3 3 -1 4 3 -1 5 3 -1 6 3 -1 7 3 -1 8 3 -1 9 3 -1 10 3 -1 11 3 -1 12 3 -DROP TABLE t1; -CREATE TABLE t1 (a INT, b CHAR(10) COLLATE latin1_bin, c INT, d INT, -PRIMARY KEY (a,b,c) USING HASH) -ENGINE=NDB -DEFAULT CHARSET=latin1 -PARTITION BY KEY (b); -insert into t1 values (1,"a",1,1),(2,"a",1,1),(3,"a",1,1); --- t1 -- - -Fragment type: 5 -K Value: 6 -Min load factor: 78 -Max load factor: 80 -Temporary table: no -Number of attributes: 4 -Number of primary keys: 3 -Length of frm data: # -Row Checksum: 1 -Row GCI: 1 -SingleUserMode: 0 -ForceVarPart: 1 -TableStatus: Retrieved --- Attributes -- -a Int PRIMARY KEY AT=FIXED ST=MEMORY -b Char(10;latin1_bin) PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY -c Int PRIMARY KEY AT=FIXED ST=MEMORY -d Int NULL AT=FIXED ST=MEMORY - --- Indexes -- -PRIMARY KEY(a, b, c) - UniqueHashIndex - - -NDBT_ProgramExit: 0 - OK - -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) NOT NULL DEFAULT '0', - `b` char(10) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', - `c` int(11) NOT NULL DEFAULT '0', - `d` int(11) DEFAULT NULL, - PRIMARY KEY (`a`,`b`,`c`) USING HASH -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (b) */ -DROP TABLE t1; -CREATE TABLE t1 (a int not null primary key) -PARTITION BY KEY(a) -(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB); -drop table t1; -CREATE TABLE t1 (a int not null primary key); -ALTER TABLE t1 -ENGINE = NDB -PARTITION BY KEY(a) -(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB); -drop table t1; -CREATE TABLE t1 (a int not null primary key) ENGINE = NDB; -ALTER TABLE t1 -PARTITION BY KEY(a) -(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB); -drop table t1; -create table t1 (a int) -engine=ndb -partition by key(a) -(partition p0, partition p1); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ -alter table t1 engine=heap; -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = MEMORY, PARTITION p1 ENGINE = MEMORY) */ -alter table t1 engine=ndb; -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ -alter table t1 engine=heap remove partitioning; -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL -) ENGINE=MEMORY DEFAULT CHARSET=latin1 -alter table t1 engine=ndb -partition by key(a) -(partition p0, partition p1 engine = ndb); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ -alter table t1 -partition by key (a) -(partition p0 engine=ndb, partition p1 engine=ndb); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ -alter table t1 remove partitioning; -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 -alter table t1 -partition by key(a) -(partition p0 engine=ndb, partition p1); -alter table t1 -engine=ndb -partition by key(a) -(partition p0 engine=ndb, partition p1 engine = ndb); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ -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; -CREATE TABLE t1 (a int primary key) -ENGINE=NDB -PARTITION BY KEY(a); -ALTER TABLE t1 OPTIMIZE PARTITION p0; -ERROR HY000: Table storage engine for 't1' doesn't have this option -ALTER TABLE t1 CHECK PARTITION p0; -ERROR HY000: Table storage engine for 't1' doesn't have this option -ALTER TABLE t1 REPAIR PARTITION p0; -ERROR HY000: Table storage engine for 't1' doesn't have this option -ALTER TABLE t1 ANALYZE PARTITION p0; -ERROR HY000: Table storage engine for 't1' doesn't have this option -ALTER TABLE t1 REBUILD PARTITION p0; -ERROR HY000: Table storage engine for 't1' doesn't have this option -DROP TABLE t1; -CREATE TABLE t1 ( -c1 MEDIUMINT NOT NULL AUTO_INCREMENT, -c2 TEXT NOT NULL, -c3 INT NOT NULL, -PRIMARY KEY(c1,c3)) -ENGINE=NDB -PARTITION BY KEY(c3) PARTITIONS 5; -ALTER TABLE t1 ADD COLUMN c4 INT AFTER c1; -DROP TABLE t1; -CREATE TABLE t1 ( -c1 MEDIUMINT NOT NULL AUTO_INCREMENT, -c2 TEXT NOT NULL, -c3 INT NOT NULL, -PRIMARY KEY(c1,c3)) -ENGINE=NDB -PARTITION BY KEY(c3); -ALTER TABLE t1 ADD COLUMN c4 INT AFTER c1; -DROP TABLE t1; diff --git a/mysql-test/suite/parts/r/ndb_partition_list.result b/mysql-test/suite/parts/r/ndb_partition_list.result deleted file mode 100644 index ce2574ddcc4..00000000000 --- a/mysql-test/suite/parts/r/ndb_partition_list.result +++ /dev/null @@ -1,51 +0,0 @@ -drop table if exists t1; -CREATE TABLE t1 ( f_int1 INTEGER NOT NULL, f_int2 INTEGER NOT NULL, -f_char1 CHAR(10), -f_char2 CHAR(10), f_charbig VARCHAR(1000), -PRIMARY KEY (f_int1,f_int2)) -ENGINE = NDB -PARTITION BY LIST(MOD(f_int1 + f_int2,4)) -(PARTITION part_3 VALUES IN (-3), -PARTITION part_2 VALUES IN (-2), -PARTITION part_1 VALUES IN (-1), -PARTITION part0 VALUES IN (0), -PARTITION part1 VALUES IN (1), -PARTITION part2 VALUES IN (2), -PARTITION part3 VALUES IN (3,4,5)); -INSERT INTO t1 SET f_int1 = -2, f_int2 = 20, f_char1 = '20', f_char2 = '20', f_charbig = '===20==='; -INSERT INTO t1 SET f_int1 = 1, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -INSERT INTO t1 SET f_int1 = 2, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -INSERT INTO t1 SET f_int1 = 3, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -INSERT INTO t1 SET f_int1 = 4, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -INSERT INTO t1 SET f_int1 = 5, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -INSERT INTO t1 SET f_int1 = 20, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -SELECT * FROM t1 ORDER BY f_int1; -f_int1 f_int2 f_char1 f_char2 f_charbig --2 20 20 20 ===20=== -1 1 1 1 ===1=== -2 1 1 1 ===1=== -3 1 1 1 ===1=== -4 1 1 1 ===1=== -5 1 1 1 ===1=== -20 1 1 1 ===1=== -DROP TABLE t1; -CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, f_char1 CHAR(10), -f_char2 CHAR(10), f_charbig VARCHAR(1000)) -ENGINE = NDB -PARTITION BY LIST(f_int1) -(PARTITION part_1 VALUES IN (-1), -PARTITION part0 VALUES IN (0,1), -PARTITION part1 VALUES IN (2)); -INSERT INTO t1 SET f_int1 = -1, f_int2 = 20, f_char1 = '20', f_char2 = '20', f_charbig = '===20==='; -INSERT INTO t1 SET f_int1 = 0, f_int2 = 20, f_char1 = '20', f_char2 = '20', f_charbig = '===20==='; -INSERT INTO t1 SET f_int1 = 1, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -INSERT INTO t1 SET f_int1 = 2, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -INSERT INTO t1 SET f_int1 = 20, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -ERROR HY000: Table has no partition for value 20 -SELECT * FROM t1 ORDER BY f_int1; -f_int1 f_int2 f_char1 f_char2 f_charbig --1 20 20 20 ===20=== -0 20 20 20 ===20=== -1 1 1 1 ===1=== -2 1 1 1 ===1=== -DROP TABLE t1; diff --git a/mysql-test/suite/parts/r/ndb_partition_range.result b/mysql-test/suite/parts/r/ndb_partition_range.result deleted file mode 100644 index cb79f04873e..00000000000 --- a/mysql-test/suite/parts/r/ndb_partition_range.result +++ /dev/null @@ -1,263 +0,0 @@ -drop table if exists t1; -CREATE TABLE t1 ( -a int not null, -b int not null, -c int not null, -primary key(a,b), -index (a)) -engine = ndb -partition by range (a) -partitions 3 -(partition x1 values less than (5), -partition x2 values less than (10), -partition x3 values less than (20)); -INSERT into t1 values (1, 1, 1); -INSERT into t1 values (6, 1, 1); -INSERT into t1 values (10, 1, 1); -INSERT into t1 values (15, 1, 1); -select * from information_schema.partitions where table_name= 't1'; -TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME -NULL test t1 x1 NULL 1 NULL RANGE NULL a NULL 5 0 0 0 # 0 0 # # NULL NULL default 0 default -NULL test t1 x2 NULL 2 NULL RANGE NULL a NULL 10 0 0 0 # 0 0 # # NULL NULL default 0 default -NULL test t1 x3 NULL 3 NULL RANGE NULL a NULL 20 0 0 0 # 0 0 # # NULL NULL default 0 default -select * from t1 order by a; -a b c -1 1 1 -6 1 1 -10 1 1 -15 1 1 -select * from t1 where a=1 order by a; -a b c -1 1 1 -select * from t1 where a=15 and b=1 order by a; -a b c -15 1 1 -select * from t1 where a=21 and b=1 order by a; -a b c -select * from t1 where a=21 order by a; -a b c -select * from t1 where a in (1,6,10,21) order by a; -a b c -1 1 1 -6 1 1 -10 1 1 -select * from t1 where b=1 and a in (1,6,10,21) order by a; -a b c -1 1 1 -6 1 1 -10 1 1 -drop table t1; -CREATE TABLE t1 ( -a int not null, -b int not null, -c int not null, -primary key(b), -unique (a)) -engine = ndb -partition by range (b) -partitions 3 -(partition x1 values less than (5), -partition x2 values less than (10), -partition x3 values less than (20)); -INSERT into t1 values (1, 1, 1); -INSERT into t1 values (2, 6, 1); -INSERT into t1 values (3, 10, 1); -INSERT into t1 values (4, 15, 1); -select * from t1 order by a; -a b c -1 1 1 -2 6 1 -3 10 1 -4 15 1 -UPDATE t1 set a = 5 WHERE b = 15; -select * from t1 order by a; -a b c -1 1 1 -2 6 1 -3 10 1 -5 15 1 -UPDATE t1 set a = 6 WHERE a = 5; -select * from t1 order by a; -a b c -1 1 1 -2 6 1 -3 10 1 -6 15 1 -select * from t1 where b=1 order by b; -a b c -1 1 1 -select * from t1 where b=15 and a=1 order by b; -a b c -select * from t1 where b=21 and a=1 order by b; -a b c -select * from t1 where b=21 order by b; -a b c -select * from t1 where b in (1,6,10,21) order by b; -a b c -1 1 1 -2 6 1 -3 10 1 -select * from t1 where a in (1,2,5,6) order by b; -a b c -1 1 1 -2 6 1 -6 15 1 -select * from t1 where a=1 and b in (1,6,10,21) order by b; -a b c -1 1 1 -DELETE from t1 WHERE b = 6; -DELETE from t1 WHERE a = 6; -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) NOT NULL, - `b` int(11) NOT NULL, - `c` int(11) NOT NULL, - PRIMARY KEY (`b`), - UNIQUE KEY `a` (`a`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (b) (PARTITION x1 VALUES LESS THAN (5) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (10) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (20) ENGINE = ndbcluster) -drop table t1; -CREATE TABLE t1 -(id MEDIUMINT NOT NULL, -b1 BIT(8), -vc VARCHAR(255), -bc CHAR(255), -d DECIMAL(10,4) DEFAULT 0, -f FLOAT DEFAULT 0, -total BIGINT UNSIGNED, -y YEAR, -t DATE) ENGINE=NDB -PARTITION BY RANGE (YEAR(t)) -(PARTITION p0 VALUES LESS THAN (1901), -PARTITION p1 VALUES LESS THAN (1946), -PARTITION p2 VALUES LESS THAN (1966), -PARTITION p3 VALUES LESS THAN (1986), -PARTITION p4 VALUES LESS THAN (2005), -PARTITION p5 VALUES LESS THAN MAXVALUE); -INSERT INTO t1 VALUES (0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); -SELECT * FROM t1; -id b1 vc bc d f total y t -0 NULL NULL NULL NULL NULL NULL NULL NULL -ALTER TABLE t1 ENGINE=MYISAM; -SELECT * FROM t1; -id b1 vc bc d f total y t -0 NULL NULL NULL NULL NULL NULL NULL NULL -DROP TABLE t1; -CREATE LOGFILE GROUP lg1 -ADD UNDOFILE 'undofile.dat' - INITIAL_SIZE 16M -UNDO_BUFFER_SIZE=1M -ENGINE=NDB; -CREATE TABLESPACE ts1 -ADD DATAFILE 'datafile.dat' - USE LOGFILE GROUP lg1 -INITIAL_SIZE 12M -ENGINE NDB; -CREATE TABLE test.t1 ( -a1 INT, -a2 TEXT NOT NULL, -a3 BIT NOT NULL, -a4 DECIMAL(8,3), -a5 INT NOT NULL, -a6 INT, -PRIMARY KEY(a1)) -TABLESPACE ts1 STORAGE DISK ENGINE=NDB -PARTITION BY LIST (a1) -(PARTITION p0 VALUES IN (1,2,3,4,5), -PARTITION p1 VALUES IN (6,7,8,9, 10), -PARTITION p2 VALUES IN (11, 12, 13, 14, 15)); -ALTER TABLE test.t1 DROP COLUMN a6; -ALTER TABLE test.t1 ADD COLUMN a6 VARCHAR(255); -SELECT COUNT(*) FROM test.t1; -COUNT(*) -15 -ALTER TABLE test.t1 DROP COLUMN a4; -SELECT COUNT(*) FROM test.t1; -COUNT(*) -15 -DROP TABLE t1; -CREATE TABLE test.t1 ( -a1 INT, -a2 TEXT NOT NULL, -a3 BIT NOT NULL, -a4 DECIMAL(8,3), -a5 INT NOT NULL, -a6 VARCHAR(255), -PRIMARY KEY(a1)) -TABLESPACE ts1 STORAGE DISK ENGINE=NDB -PARTITION BY HASH(a1) -PARTITIONS 4; -SELECT COUNT(*) FROM test.t1; -COUNT(*) -15 -ALTER TABLE test.t1 DROP COLUMN a4; -SELECT COUNT(*) FROM test.t1; -COUNT(*) -15 -DROP TABLE t1; -ALTER TABLESPACE ts1 -DROP DATAFILE 'datafile.dat' -ENGINE=NDB; -DROP TABLESPACE ts1 ENGINE=NDB; -DROP LOGFILE GROUP lg1 ENGINE=NDB; -CREATE TABLE t1 -(id MEDIUMINT NOT NULL, -b1 BIT(8), -vc VARCHAR(255), -bc CHAR(255), -d DECIMAL(10,4) DEFAULT 0, -f FLOAT DEFAULT 0, -total BIGINT UNSIGNED, -y YEAR, -t DATE) ENGINE=NDB -PARTITION BY LIST(id) -(PARTITION p0 VALUES IN (2, 4), -PARTITION p1 VALUES IN (42, 142)); -INSERT INTO t1 VALUES (2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); -SELECT * FROM t1; -id b1 vc bc d f total y t -2 NULL NULL NULL NULL NULL NULL NULL NULL -ALTER TABLE t1 ADD PARTITION -(PARTITION p2 VALUES IN (412)); -SELECT * FROM t1; -id b1 vc bc d f total y t -2 NULL NULL NULL NULL NULL NULL NULL NULL -DROP TABLE t1; -CREATE TABLE t1 ( -a int not null, -b int not null, -c int not null) -partition by list(a) -partitions 2 -(partition x123 values in (1,5,6), -partition x234 values in (4,7,8)); -INSERT into t1 VALUES (5,1,1); -select * from t1; -a b c -5 1 1 -UPDATE t1 SET a=8 WHERE a=5 AND b=1; -select * from t1; -a b c -8 1 1 -drop table t1; -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) engine=ndb -PARTITION BY RANGE(f1) -( PARTITION part1 VALUES LESS THAN (2), -PARTITION part2 VALUES LESS THAN (1000)); -INSERT INTO t1 VALUES(1, '---1---'); -INSERT INTO t1 VALUES(2, '---2---'); -select * from t1 order by f1; -f1 f2 -1 ---1--- -2 ---2--- -UPDATE t1 SET f1 = f1 + 4 WHERE f1 = 2; -select * from t1 order by f1; -f1 f2 -1 ---1--- -6 ---2--- -UPDATE t1 SET f1 = f1 + 4 WHERE f1 = 1; -select * from t1 order by f1; -f1 f2 -5 ---1--- -6 ---2--- -drop table t1; diff --git a/mysql-test/suite/parts/r/part_supported_sql_func_ndb.result b/mysql-test/suite/parts/r/part_supported_sql_func_ndb.result index 5dc27d16538..e81b926e092 100644 --- a/mysql-test/suite/parts/r/part_supported_sql_func_ndb.result +++ b/mysql-test/suite/parts/r/part_supported_sql_func_ndb.result @@ -31,14 +31,12 @@ subpartition by hash(abs(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 int) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(abs(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 int) engine='NDB' partition by range(colint) @@ -55,9 +53,9 @@ insert into t2 values (17 ); insert into t3 values (5 ); insert into t3 values (13 ); insert into t3 values (17 ); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_int.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_int.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_int.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t6; select abs(col1) from t1 order by col1; abs(col1) 5 @@ -414,14 +412,12 @@ subpartition by hash(abs(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(abs(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -585,37 +581,18 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -13 -15 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -13 -15 alter table t55 -partition by list(colint) -subpartition by hash(abs(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(abs(col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` int(11) DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (abs(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (abs(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 15 @@ -663,208 +640,6 @@ colint col1 50 56 51 34 55 123 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15 -2 13 -3 15 -4 17 -5 23 -6 34 -7 56 -8 56 -9 45 -10 34 -11 78 -12 89 -13 67 -14 46 -15 34 -16 324 -17 345 -18 34 -19 78 -20 567 -21 4 -22 435 -23 34 -24 45 -25 4565 -26 4 -27 3 -28 2 -29 3 -30 15 -31 6 -32 8 -33 9 -34 745 -35 34 -36 34 -37 324 -38 67 -39 78 -40 89 -41 90 -42 78967 -50 56 -51 34 -55 123 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (abs(15)), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15 -2 13 -3 15 -4 17 -5 23 -6 34 -7 56 -8 56 -9 45 -10 34 -11 78 -12 89 -13 67 -14 46 -15 34 -16 324 -17 345 -18 34 -19 78 -20 567 -21 4 -22 435 -23 34 -24 45 -25 4565 -26 4 -27 3 -28 2 -29 3 -30 15 -31 6 -32 8 -33 9 -34 745 -35 34 -36 34 -37 324 -38 67 -39 78 -40 89 -41 90 -42 78967 -50 56 -51 34 -55 123 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15 -2 13 -3 15 -4 17 -5 23 -6 34 -7 56 -8 56 -9 45 -10 34 -11 78 -12 89 -13 67 -14 46 -15 34 -16 324 -17 345 -18 34 -19 78 -20 567 -21 4 -22 435 -23 34 -24 45 -25 4565 -26 4 -27 3 -28 2 -29 3 -30 15 -31 6 -32 8 -33 9 -34 745 -35 34 -36 34 -37 324 -38 67 -39 78 -40 89 -41 90 -42 78967 -50 56 -51 34 -55 123 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (abs(15)), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15 -2 13 -3 15 -4 17 -5 23 -6 34 -7 56 -8 56 -9 45 -10 34 -11 78 -12 89 -13 67 -14 46 -15 34 -16 324 -17 345 -18 34 -19 78 -20 567 -21 4 -22 435 -23 34 -24 45 -25 4565 -26 4 -27 3 -28 2 -29 3 -30 15 -31 6 -32 8 -33 9 -34 745 -35 34 -36 34 -37 324 -38 67 -39 78 -40 89 -41 90 -42 78967 -50 56 -51 34 -55 123 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with abs(col1) ------------------------------------------------------------------------- @@ -1138,130 +913,6 @@ colint col1 51 34 55 123 60 13 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -15 -select * from t2 order by col1; -col1 -13 -15 -17 -select * from t3 order by col1; -col1 -13 -15 -17 -select * from t4 order by colint; -colint col1 -15 34 -16 324 -17 345 -18 34 -19 78 -20 567 -21 4 -22 435 -23 34 -24 45 -25 4565 -26 4 -27 3 -28 2 -29 3 -30 15 -31 6 -32 8 -33 9 -34 745 -35 34 -36 34 -37 324 -38 67 -39 78 -40 89 -41 90 -42 78967 -50 56 -51 34 -55 123 -60 13 -select * from t5 order by colint; -colint col1 -11 78 -12 89 -13 67 -14 46 -15 34 -16 324 -17 345 -18 34 -19 78 -20 567 -21 4 -22 435 -23 34 -24 45 -25 4565 -26 4 -27 3 -28 2 -29 3 -30 15 -31 6 -32 8 -33 9 -34 745 -35 34 -36 34 -37 324 -38 67 -39 78 -40 89 -41 90 -42 78967 -50 56 -51 34 -55 123 -60 13 -select * from t6 order by colint; -colint col1 -15 34 -16 324 -17 345 -18 34 -19 78 -20 567 -21 4 -22 435 -23 34 -24 45 -25 4565 -26 4 -27 3 -28 2 -29 3 -30 15 -31 6 -32 8 -33 9 -34 745 -35 34 -36 34 -37 324 -38 67 -39 78 -40 89 -41 90 -42 78967 -50 56 -51 34 -55 123 -60 13 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with abs(col1) ------------------------------------------------------------------------- @@ -1535,26 +1186,113 @@ colint col1 51 34 55 123 60 13 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- mod(col1,10) in partition with coltype int +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with mod(col1,10) +------------------------------------------------------------------------- +create table t1 (col1 int) engine='NDB' +partition by range(mod(col1,10)) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 int) engine='NDB' +partition by list(mod(col1,10)) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 int) engine='NDB' +partition by hash(mod(col1,10)); +create table t4 (colint int, col1 int) engine='NDB' +partition by range(colint) +subpartition by hash(mod(col1,10)) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 int) engine='NDB' +partition by list(colint) +subpartition by hash(mod(col1,10)) subpartitions 2 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 int) engine='NDB' +partition by range(colint) +(partition p0 values less than (mod(15,10)), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with mod(col1,10) +------------------------------------------------------------------------- +insert into t1 values (5); +insert into t1 values (19); +insert into t2 values (5); +insert into t2 values (19); +insert into t2 values (17); +insert into t3 values (5); +insert into t3 values (19); +insert into t3 values (17); +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t6; +select mod(col1,10) from t1 order by col1; +mod(col1,10) +5 +9 +select * from t1 order by col1; col1 -15 -select * from t22 order by col1; +5 +19 +select * from t2 order by col1; col1 -13 -15 +5 17 -select * from t33 order by col1; +19 +select * from t3 order by col1; col1 -13 -15 +5 17 -select * from t44 order by colint; +19 +select * from t4 order by colint; colint col1 +1 5 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 15 34 16 324 17 345 @@ -1570,7 +1308,7 @@ colint col1 27 3 28 2 29 3 -30 15 +30 5 31 6 32 8 33 9 @@ -1586,9 +1324,132 @@ colint col1 50 56 51 34 55 123 -60 13 -select * from t55 order by colint; +select * from t5 order by colint; colint col1 +1 5 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 5 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +select * from t6 order by colint; +colint col1 +1 5 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 5 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +update t1 set col1=15 where col1=5; +update t2 set col1=15 where col1=5; +update t3 set col1=15 where col1=5; +update t4 set col1=15 where col1=5; +update t5 set col1=15 where col1=5; +update t6 set col1=15 where col1=5; +select * from t1 order by col1; +col1 +15 +19 +select * from t2 order by col1; +col1 +15 +17 +19 +select * from t3 order by col1; +col1 +15 +17 +19 +select * from t4 order by colint; +colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 11 78 12 89 13 67 @@ -1624,9 +1485,22 @@ colint col1 50 56 51 34 55 123 -60 13 -select * from t66 order by colint; +select * from t5 order by colint; colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 15 34 16 324 17 345 @@ -1658,158 +1532,55 @@ colint col1 50 56 51 34 55 123 -60 13 -------------------------- ----- some alter table end -------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -------------------------------------------------------------------------- ---- ascii(col1) in partition with coltype char(1) -------------------------------------------------------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -------------------------------------------------------------------------- ---- Create tables with ascii(col1) -------------------------------------------------------------------------- -create table t1 (col1 char(1)) engine='NDB' -partition by range(ascii(col1)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t2 (col1 char(1)) engine='NDB' -partition by list(ascii(col1)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t3 (col1 char(1)) engine='NDB' -partition by hash(ascii(col1)); -create table t4 (colint int, col1 char(1)) engine='NDB' -partition by range(colint) -subpartition by hash(ascii(col1)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t5 (colint int, col1 char(1)) engine='NDB' -partition by list(colint) -subpartition by hash(ascii(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t6 (colint int, col1 char(1)) engine='NDB' -partition by range(colint) -(partition p0 values less than (ascii('5')), -partition p1 values less than maxvalue); -------------------------------------------------------------------------- ---- Access tables with ascii(col1) -------------------------------------------------------------------------- -insert into t1 values ('1'); -insert into t1 values ('9'); -insert into t2 values ('1'); -insert into t2 values ('9'); -insert into t2 values ('3'); -insert into t3 values ('1'); -insert into t3 values ('9'); -insert into t3 values ('3'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t6; -select ascii(col1) from t1 order by col1; -ascii(col1) -49 -57 -select * from t1 order by col1; -col1 -1 -9 -select * from t2 order by col1; -col1 -1 -3 -9 -select * from t3 order by col1; -col1 -1 -3 -9 -select * from t4 order by colint; -colint col1 -1 1 -2 9 -3 3 -4 8 -select * from t5 order by colint; -colint col1 -1 1 -2 9 -3 3 -4 8 select * from t6 order by colint; colint col1 -1 1 -2 9 -3 3 -4 8 -update t1 set col1='8' where col1='1'; -update t2 set col1='8' where col1='1'; -update t3 set col1='8' where col1='1'; -update t4 set col1='8' where col1='1'; -update t5 set col1='8' where col1='1'; -update t6 set col1='8' where col1='1'; -select * from t1 order by col1; -col1 -8 -9 -select * from t2 order by col1; -col1 -3 -8 -9 -select * from t3 order by col1; -col1 -3 -8 -9 -select * from t4 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -select * from t5 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -select * from t6 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 ------------------------------------------------------------------------- ---- Alter tables with ascii(col1) +--- Alter tables with mod(col1,10) ------------------------------------------------------------------------- drop table if exists t11 ; drop table if exists t22 ; @@ -1824,11 +1595,11 @@ create table t44 engine='NDB' as select * from t4; create table t55 engine='NDB' as select * from t5; create table t66 engine='NDB' as select * from t6; alter table t11 -partition by range(ascii(col1)) +partition by range(mod(col1,10)) (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t22 -partition by list(ascii(col1)) +partition by list(mod(col1,10)) (partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), partition p1 values in (11,12,13,14,15,16,17,18,19,20), partition p2 values in (21,22,23,24,25,26,27,28,29,30), @@ -1837,1634 +1608,243 @@ partition p4 values in (41,42,43,44,45,46,47,48,49,50), partition p5 values in (51,52,53,54,55,56,57,58,59,60) ); alter table t33 -partition by hash(ascii(col1)); +partition by hash(mod(col1,10)); alter table t44 partition by range(colint) -subpartition by hash(ascii(col1)) subpartitions 2 +subpartition by hash(mod(col1,10)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) -subpartition by hash(ascii(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(mod(col1,10)) subpartitions 2 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) -(partition p0 values less than (ascii('5')), +(partition p0 values less than (mod(15,10)), partition p1 values less than maxvalue); select * from t11 order by col1; col1 -8 -9 +15 +19 select * from t22 order by col1; col1 -3 -8 -9 +15 +17 +19 select * from t33 order by col1; col1 -3 -8 -9 +15 +17 +19 select * from t44 order by colint; colint col1 -1 8 -2 9 -3 3 -4 8 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 select * from t55 order by colint; colint col1 -1 8 -2 9 -3 3 -4 8 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 select * from t66 order by colint; colint col1 -1 8 -2 9 -3 3 -4 8 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -8 -9 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -8 -9 alter table t55 -partition by list(colint) -subpartition by hash(ascii(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(mod(col1,10)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, - `col1` char(1) DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (ascii(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ + `col1` int(11) DEFAULT NULL +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (mod(col1,10)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (ascii('5')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (ascii('5')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 ------------------------------------------------------------------------- ---- Delete rows and partitions of tables with ascii(col1) -------------------------------------------------------------------------- -delete from t1 where col1='9'; -delete from t2 where col1='9'; -delete from t3 where col1='9'; -delete from t4 where col1='9'; -delete from t5 where col1='9'; -delete from t6 where col1='9'; -select * from t1 order by col1; -col1 -8 -select * from t2 order by col1; -col1 -3 -8 -select * from t3 order by col1; -col1 -3 -8 -select * from t4 order by colint; -colint col1 -1 8 -3 3 -4 8 -select * from t5 order by colint; -colint col1 -1 8 -3 3 -4 8 -insert into t1 values ('9'); -insert into t2 values ('9'); -insert into t3 values ('9'); -insert into t4 values (60,'9'); -insert into t5 values (60,'9'); -insert into t6 values (60,'9'); -select * from t1 order by col1; -col1 -8 -9 -select * from t2 order by col1; -col1 -3 -8 -9 -select * from t3 order by col1; -col1 -3 -8 -9 -select * from t4 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t5 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t6 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -8 -9 -select * from t2 order by col1; -col1 -3 -8 -9 -select * from t3 order by col1; -col1 -3 -8 -9 -select * from t4 order by colint; -colint col1 -60 9 -select * from t5 order by colint; -colint col1 -60 9 -select * from t6 order by colint; -colint col1 -60 9 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with ascii(col1) -------------------------------------------------------------------------- -delete from t11 where col1='9'; -delete from t22 where col1='9'; -delete from t33 where col1='9'; -delete from t44 where col1='9'; -delete from t55 where col1='9'; -delete from t66 where col1='9'; -select * from t11 order by col1; -col1 -8 -select * from t22 order by col1; -col1 -3 -8 -select * from t33 order by col1; -col1 -3 -8 -select * from t44 order by colint; -colint col1 -1 8 -3 3 -4 8 -select * from t55 order by colint; -colint col1 -1 8 -3 3 -4 8 -insert into t11 values ('9'); -insert into t22 values ('9'); -insert into t33 values ('9'); -insert into t44 values (60,'9'); -insert into t55 values (60,'9'); -insert into t66 values (60,'9'); -select * from t11 order by col1; -col1 -8 -9 -select * from t22 order by col1; -col1 -3 -8 -9 -select * from t33 order by col1; -col1 -3 -8 -9 -select * from t44 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t55 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t66 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -8 -9 -select * from t22 order by col1; -col1 -3 -8 -9 -select * from t33 order by col1; -col1 -3 -8 -9 -select * from t44 order by colint; -colint col1 -60 9 -select * from t55 order by colint; -colint col1 -60 9 -select * from t66 order by colint; -colint col1 -60 9 -------------------------- ----- some alter table end -------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -------------------------------------------------------------------------- ---- cast(ceiling(col1) as signed integer) in partition with coltype float(7,4) -------------------------------------------------------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -------------------------------------------------------------------------- ---- Create tables with cast(ceiling(col1) as signed integer) -------------------------------------------------------------------------- -create table t1 (col1 float(7,4)) engine='NDB' -partition by range(cast(ceiling(col1) as signed integer)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t2 (col1 float(7,4)) engine='NDB' -partition by list(cast(ceiling(col1) as signed integer)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t3 (col1 float(7,4)) engine='NDB' -partition by hash(cast(ceiling(col1) as signed integer)); -create table t4 (colint int, col1 float(7,4)) engine='NDB' -partition by range(colint) -subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t5 (colint int, col1 float(7,4)) engine='NDB' -partition by list(colint) -subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t6 (colint int, col1 float(7,4)) engine='NDB' -partition by range(colint) -(partition p0 values less than (cast(ceiling(15) as signed integer)), -partition p1 values less than maxvalue); -------------------------------------------------------------------------- ---- Access tables with cast(ceiling(col1) as signed integer) -------------------------------------------------------------------------- -insert into t1 values (5.1230); -insert into t1 values (13.345); -insert into t2 values (5.1230); -insert into t2 values (13.345); -insert into t2 values (17.987); -insert into t3 values (5.1230); -insert into t3 values (13.345); -insert into t3 values (17.987); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t6; -select cast(ceiling(col1) as signed integer) from t1 order by col1; -cast(ceiling(col1) as signed integer) -6 -14 -select * from t1 order by col1; -col1 -5.1230 -13.3450 -select * from t2 order by col1; -col1 -5.1230 -13.3450 -17.9870 -select * from t3 order by col1; -col1 -5.1230 -13.3450 -17.9870 -select * from t4 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t5 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t6 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -update t1 set col1=15.654 where col1=5.1230; -update t2 set col1=15.654 where col1=5.1230; -update t3 set col1=15.654 where col1=5.1230; -update t4 set col1=15.654 where col1=5.1230; -update t5 set col1=15.654 where col1=5.1230; -update t6 set col1=15.654 where col1=5.1230; -select * from t1 order by col1; -col1 -13.3450 -15.6540 -select * from t2 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t5 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t6 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -------------------------------------------------------------------------- ---- Alter tables with cast(ceiling(col1) as signed integer) -------------------------------------------------------------------------- -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -create table t11 engine='NDB' as select * from t1; -create table t22 engine='NDB' as select * from t2; -create table t33 engine='NDB' as select * from t3; -create table t44 engine='NDB' as select * from t4; -create table t55 engine='NDB' as select * from t5; -create table t66 engine='NDB' as select * from t6; -alter table t11 -partition by range(cast(ceiling(col1) as signed integer)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t22 -partition by list(cast(ceiling(col1) as signed integer)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t33 -partition by hash(cast(ceiling(col1) as signed integer)); -alter table t44 -partition by range(colint) -subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t55 -partition by list(colint) -subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t66 -partition by range(colint) -(partition p0 values less than (cast(ceiling(15) as signed integer)), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -select * from t22 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t55 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 ---------------------------- ----- some alter table begin ---------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -alter table t55 -partition by list(colint) -subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -show create table t55; -Table Create Table -t55 CREATE TABLE `t55` ( - `colint` int(11) DEFAULT NULL, - `col1` float(7,4) DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(ceiling(col1) as signed integer)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ -select * from t55 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (cast(ceiling(15) as signed integer)), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (cast(ceiling(15) as signed integer)), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with cast(ceiling(col1) as signed integer) -------------------------------------------------------------------------- -delete from t1 where col1=13.345; -delete from t2 where col1=13.345; -delete from t3 where col1=13.345; -delete from t4 where col1=13.345; -delete from t5 where col1=13.345; -delete from t6 where col1=13.345; -select * from t1 order by col1; -col1 -15.6540 -select * from t2 order by col1; -col1 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -select * from t5 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -insert into t1 values (13.345); -insert into t2 values (13.345); -insert into t3 values (13.345); -insert into t4 values (60,13.345); -insert into t5 values (60,13.345); -insert into t6 values (60,13.345); -select * from t1 order by col1; -col1 -13.3450 -15.6540 -select * from t2 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t5 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t6 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -15.6540 -select * from t2 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -60 13.3450 -select * from t5 order by colint; -colint col1 -60 13.3450 -select * from t6 order by colint; -colint col1 -60 13.3450 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with cast(ceiling(col1) as signed integer) -------------------------------------------------------------------------- -delete from t11 where col1=13.345; -delete from t22 where col1=13.345; -delete from t33 where col1=13.345; -delete from t44 where col1=13.345; -delete from t55 where col1=13.345; -delete from t66 where col1=13.345; -select * from t11 order by col1; -col1 -15.6540 -select * from t22 order by col1; -col1 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -select * from t55 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -insert into t11 values (13.345); -insert into t22 values (13.345); -insert into t33 values (13.345); -insert into t44 values (60,13.345); -insert into t55 values (60,13.345); -insert into t66 values (60,13.345); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -select * from t22 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t55 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t66 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -15.6540 -select * from t22 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -60 13.3450 -select * from t55 order by colint; -colint col1 -60 13.3450 -select * from t66 order by colint; -colint col1 -60 13.3450 -------------------------- ----- some alter table end -------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -------------------------------------------------------------------------- ---- cast(floor(col1) as signed) in partition with coltype float(7,4) -------------------------------------------------------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -------------------------------------------------------------------------- ---- Create tables with cast(floor(col1) as signed) -------------------------------------------------------------------------- -create table t1 (col1 float(7,4)) engine='NDB' -partition by range(cast(floor(col1) as signed)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t2 (col1 float(7,4)) engine='NDB' -partition by list(cast(floor(col1) as signed)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t3 (col1 float(7,4)) engine='NDB' -partition by hash(cast(floor(col1) as signed)); -create table t4 (colint int, col1 float(7,4)) engine='NDB' -partition by range(colint) -subpartition by hash(cast(floor(col1) as signed)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t5 (colint int, col1 float(7,4)) engine='NDB' -partition by list(colint) -subpartition by hash(cast(floor(col1) as signed)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t6 (colint int, col1 float(7,4)) engine='NDB' -partition by range(colint) -(partition p0 values less than (cast(floor(15.123) as signed)), -partition p1 values less than maxvalue); -------------------------------------------------------------------------- ---- Access tables with cast(floor(col1) as signed) -------------------------------------------------------------------------- -insert into t1 values (5.1230); -insert into t1 values (13.345); -insert into t2 values (5.1230); -insert into t2 values (13.345); -insert into t2 values (17.987); -insert into t3 values (5.1230); -insert into t3 values (13.345); -insert into t3 values (17.987); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t6; -select cast(floor(col1) as signed) from t1 order by col1; -cast(floor(col1) as signed) -5 -13 -select * from t1 order by col1; -col1 -5.1230 -13.3450 -select * from t2 order by col1; -col1 -5.1230 -13.3450 -17.9870 -select * from t3 order by col1; -col1 -5.1230 -13.3450 -17.9870 -select * from t4 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t5 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t6 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -update t1 set col1=15.654 where col1=5.1230; -update t2 set col1=15.654 where col1=5.1230; -update t3 set col1=15.654 where col1=5.1230; -update t4 set col1=15.654 where col1=5.1230; -update t5 set col1=15.654 where col1=5.1230; -update t6 set col1=15.654 where col1=5.1230; -select * from t1 order by col1; -col1 -13.3450 -15.6540 -select * from t2 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t5 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t6 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -------------------------------------------------------------------------- ---- Alter tables with cast(floor(col1) as signed) -------------------------------------------------------------------------- -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -create table t11 engine='NDB' as select * from t1; -create table t22 engine='NDB' as select * from t2; -create table t33 engine='NDB' as select * from t3; -create table t44 engine='NDB' as select * from t4; -create table t55 engine='NDB' as select * from t5; -create table t66 engine='NDB' as select * from t6; -alter table t11 -partition by range(cast(floor(col1) as signed)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t22 -partition by list(cast(floor(col1) as signed)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t33 -partition by hash(cast(floor(col1) as signed)); -alter table t44 -partition by range(colint) -subpartition by hash(cast(floor(col1) as signed)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t55 -partition by list(colint) -subpartition by hash(cast(floor(col1) as signed)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t66 -partition by range(colint) -(partition p0 values less than (cast(floor(15.123) as signed)), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -select * from t22 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t55 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 ---------------------------- ----- some alter table begin ---------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -alter table t55 -partition by list(colint) -subpartition by hash(cast(floor(col1) as signed)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -show create table t55; -Table Create Table -t55 CREATE TABLE `t55` ( - `colint` int(11) DEFAULT NULL, - `col1` float(7,4) DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(floor(col1) as signed)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ -select * from t55 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (cast(floor(15.123) as signed)), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (cast(floor(15.123) as signed)), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 15.6540 -2 13.3450 -3 17.9870 -4 15.6540 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with cast(floor(col1) as signed) -------------------------------------------------------------------------- -delete from t1 where col1=13.345; -delete from t2 where col1=13.345; -delete from t3 where col1=13.345; -delete from t4 where col1=13.345; -delete from t5 where col1=13.345; -delete from t6 where col1=13.345; -select * from t1 order by col1; -col1 -15.6540 -select * from t2 order by col1; -col1 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -select * from t5 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -insert into t1 values (13.345); -insert into t2 values (13.345); -insert into t3 values (13.345); -insert into t4 values (60,13.345); -insert into t5 values (60,13.345); -insert into t6 values (60,13.345); -select * from t1 order by col1; -col1 -13.3450 -15.6540 -select * from t2 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t5 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t6 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -15.6540 -select * from t2 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t3 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t4 order by colint; -colint col1 -60 13.3450 -select * from t5 order by colint; -colint col1 -60 13.3450 -select * from t6 order by colint; -colint col1 -60 13.3450 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with cast(floor(col1) as signed) -------------------------------------------------------------------------- -delete from t11 where col1=13.345; -delete from t22 where col1=13.345; -delete from t33 where col1=13.345; -delete from t44 where col1=13.345; -delete from t55 where col1=13.345; -delete from t66 where col1=13.345; -select * from t11 order by col1; -col1 -15.6540 -select * from t22 order by col1; -col1 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -select * from t55 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -insert into t11 values (13.345); -insert into t22 values (13.345); -insert into t33 values (13.345); -insert into t44 values (60,13.345); -insert into t55 values (60,13.345); -insert into t66 values (60,13.345); -select * from t11 order by col1; -col1 -13.3450 -15.6540 -select * from t22 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t55 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -select * from t66 order by colint; -colint col1 -1 15.6540 -3 17.9870 -4 15.6540 -60 13.3450 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -15.6540 -select * from t22 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t33 order by col1; -col1 -13.3450 -15.6540 -17.9870 -select * from t44 order by colint; -colint col1 -60 13.3450 -select * from t55 order by colint; -colint col1 -60 13.3450 -select * from t66 order by colint; -colint col1 -60 13.3450 -------------------------- ----- some alter table end -------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -------------------------------------------------------------------------- ---- cast(mod(col1,10) as signed) in partition with coltype float(7,4) -------------------------------------------------------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -------------------------------------------------------------------------- ---- Create tables with cast(mod(col1,10) as signed) -------------------------------------------------------------------------- -create table t1 (col1 float(7,4)) engine='NDB' -partition by range(cast(mod(col1,10) as signed)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t2 (col1 float(7,4)) engine='NDB' -partition by list(cast(mod(col1,10) as signed)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t3 (col1 float(7,4)) engine='NDB' -partition by hash(cast(mod(col1,10) as signed)); -create table t4 (colint int, col1 float(7,4)) engine='NDB' -partition by range(colint) -subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t5 (colint int, col1 float(7,4)) engine='NDB' -partition by list(colint) -subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t6 (colint int, col1 float(7,4)) engine='NDB' -partition by range(colint) -(partition p0 values less than (cast(mod(15,10) as signed)), -partition p1 values less than maxvalue); -------------------------------------------------------------------------- ---- Access tables with cast(mod(col1,10) as signed) -------------------------------------------------------------------------- -insert into t1 values (5.0000); -insert into t1 values (19); -insert into t2 values (5.0000); -insert into t2 values (19); -insert into t2 values (17); -insert into t3 values (5.0000); -insert into t3 values (19); -insert into t3 values (17); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t6; -select cast(mod(col1,10) as signed) from t1 order by col1; -cast(mod(col1,10) as signed) -5 -9 -select * from t1 order by col1; -col1 -5.0000 -19.0000 -select * from t2 order by col1; -col1 -5.0000 -17.0000 -19.0000 -select * from t3 order by col1; -col1 -5.0000 -17.0000 -19.0000 -select * from t4 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t5 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t6 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -update t1 set col1=15 where col1=5.0000; -update t2 set col1=15 where col1=5.0000; -update t3 set col1=15 where col1=5.0000; -update t4 set col1=15 where col1=5.0000; -update t5 set col1=15 where col1=5.0000; -update t6 set col1=15 where col1=5.0000; -select * from t1 order by col1; -col1 -15.0000 -19.0000 -select * from t2 order by col1; -col1 -15.0000 -17.0000 -19.0000 -select * from t3 order by col1; -col1 -15.0000 -17.0000 -19.0000 -select * from t4 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t5 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t6 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -------------------------------------------------------------------------- ---- Alter tables with cast(mod(col1,10) as signed) -------------------------------------------------------------------------- -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -create table t11 engine='NDB' as select * from t1; -create table t22 engine='NDB' as select * from t2; -create table t33 engine='NDB' as select * from t3; -create table t44 engine='NDB' as select * from t4; -create table t55 engine='NDB' as select * from t5; -create table t66 engine='NDB' as select * from t6; -alter table t11 -partition by range(cast(mod(col1,10) as signed)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t22 -partition by list(cast(mod(col1,10) as signed)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t33 -partition by hash(cast(mod(col1,10) as signed)); -alter table t44 -partition by range(colint) -subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t55 -partition by list(colint) -subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t66 -partition by range(colint) -(partition p0 values less than (cast(mod(15,10) as signed)), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -15.0000 -19.0000 -select * from t22 order by col1; -col1 -15.0000 -17.0000 -19.0000 -select * from t33 order by col1; -col1 -15.0000 -17.0000 -19.0000 -select * from t44 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t55 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -select * from t66 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 ---------------------------- ----- some alter table begin ---------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -15.0000 -19.0000 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -15.0000 -19.0000 -alter table t55 -partition by list(colint) -subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -show create table t55; -Table Create Table -t55 CREATE TABLE `t55` ( - `colint` int(11) DEFAULT NULL, - `col1` float(7,4) DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(mod(col1,10) as signed)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ -select * from t55 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (cast(mod(15,10) as signed)), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (cast(mod(15,10) as signed)), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with cast(mod(col1,10) as signed) +--- Delete rows and partitions of tables with mod(col1,10) ------------------------------------------------------------------------- delete from t1 where col1=19; delete from t2 where col1=19; @@ -3474,27 +1854,109 @@ delete from t5 where col1=19; delete from t6 where col1=19; select * from t1 order by col1; col1 -15.0000 +15 select * from t2 order by col1; col1 -15.0000 -17.0000 +15 +17 select * from t3 order by col1; col1 -15.0000 -17.0000 +15 +17 select * from t4 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 select * from t5 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 insert into t1 values (19); insert into t2 values (19); insert into t3 values (19); @@ -3503,64 +1965,164 @@ insert into t5 values (60,19); insert into t6 values (60,19); select * from t1 order by col1; col1 -15.0000 -19.0000 +15 +19 select * from t2 order by col1; col1 -15.0000 -17.0000 -19.0000 +15 +17 +19 select * from t3 order by col1; col1 -15.0000 -17.0000 -19.0000 +15 +17 +19 select * from t4 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -60 19.0000 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 select * from t5 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -60 19.0000 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 select * from t6 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -60 19.0000 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -select * from t2 order by col1; -col1 -select * from t3 order by col1; -col1 -15.0000 -17.0000 -19.0000 -select * from t4 order by colint; -colint col1 -60 19.0000 -select * from t5 order by colint; -colint col1 -60 19.0000 -select * from t6 order by colint; -colint col1 -60 19.0000 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 ------------------------------------------------------------------------- ---- Delete rows and partitions of tables with cast(mod(col1,10) as signed) +--- Delete rows and partitions of tables with mod(col1,10) ------------------------------------------------------------------------- delete from t11 where col1=19; delete from t22 where col1=19; @@ -3570,27 +2132,109 @@ delete from t55 where col1=19; delete from t66 where col1=19; select * from t11 order by col1; col1 -15.0000 +15 select * from t22 order by col1; col1 -15.0000 -17.0000 +15 +17 select * from t33 order by col1; col1 -15.0000 -17.0000 +15 +17 select * from t44 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 select * from t55 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 insert into t11 values (19); insert into t22 values (19); insert into t33 values (19); @@ -3599,560 +2243,162 @@ insert into t55 values (60,19); insert into t66 values (60,19); select * from t11 order by col1; col1 -15.0000 -19.0000 +15 +19 select * from t22 order by col1; col1 -15.0000 -17.0000 -19.0000 +15 +17 +19 select * from t33 order by col1; col1 -15.0000 -17.0000 -19.0000 +15 +17 +19 select * from t44 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -60 19.0000 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 select * from t55 order by colint; colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -60 19.0000 -select * from t66 order by colint; -colint col1 -1 5.1230 -2 13.3450 -3 17.9870 -4 15.6540 -60 19.0000 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -select * from t22 order by col1; -col1 -select * from t33 order by col1; -col1 -15.0000 -17.0000 -19.0000 -select * from t44 order by colint; -colint col1 -60 19.0000 -select * from t55 order by colint; -colint col1 -60 19.0000 -select * from t66 order by colint; -colint col1 -60 19.0000 -------------------------- ----- some alter table end -------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -------------------------------------------------------------------------- ---- ord(col1) in partition with coltype char(3) -------------------------------------------------------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -------------------------------------------------------------------------- ---- Create tables with ord(col1) -------------------------------------------------------------------------- -create table t1 (col1 char(3)) engine='NDB' -partition by range(ord(col1)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t2 (col1 char(3)) engine='NDB' -partition by list(ord(col1)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t3 (col1 char(3)) engine='NDB' -partition by hash(ord(col1)); -create table t4 (colint int, col1 char(3)) engine='NDB' -partition by range(colint) -subpartition by hash(ord(col1)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t5 (colint int, col1 char(3)) engine='NDB' -partition by list(colint) -subpartition by hash(ord(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t6 (colint int, col1 char(3)) engine='NDB' -partition by range(colint) -(partition p0 values less than (ord('a')), -partition p1 values less than maxvalue); -------------------------------------------------------------------------- ---- Access tables with ord(col1) -------------------------------------------------------------------------- -insert into t1 values ('1'); -insert into t1 values ('9'); -insert into t2 values ('1'); -insert into t2 values ('9'); -insert into t2 values ('3'); -insert into t3 values ('1'); -insert into t3 values ('9'); -insert into t3 values ('3'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t6; -select ord(col1) from t1 order by col1; -ord(col1) -49 -57 -select * from t1 order by col1; -col1 -1 -9 -select * from t2 order by col1; -col1 -1 -3 -9 -select * from t3 order by col1; -col1 -1 -3 -9 -select * from t4 order by colint; -colint col1 -1 1 -2 9 -3 3 -4 8 -select * from t5 order by colint; -colint col1 -1 1 -2 9 -3 3 -4 8 -select * from t6 order by colint; -colint col1 -1 1 -2 9 -3 3 -4 8 -update t1 set col1='8' where col1='1'; -update t2 set col1='8' where col1='1'; -update t3 set col1='8' where col1='1'; -update t4 set col1='8' where col1='1'; -update t5 set col1='8' where col1='1'; -update t6 set col1='8' where col1='1'; -select * from t1 order by col1; -col1 -8 -9 -select * from t2 order by col1; -col1 -3 -8 -9 -select * from t3 order by col1; -col1 -3 -8 -9 -select * from t4 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -select * from t5 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -select * from t6 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -------------------------------------------------------------------------- ---- Alter tables with ord(col1) -------------------------------------------------------------------------- -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -create table t11 engine='NDB' as select * from t1; -create table t22 engine='NDB' as select * from t2; -create table t33 engine='NDB' as select * from t3; -create table t44 engine='NDB' as select * from t4; -create table t55 engine='NDB' as select * from t5; -create table t66 engine='NDB' as select * from t6; -alter table t11 -partition by range(ord(col1)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t22 -partition by list(ord(col1)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t33 -partition by hash(ord(col1)); -alter table t44 -partition by range(colint) -subpartition by hash(ord(col1)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t55 -partition by list(colint) -subpartition by hash(ord(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t66 -partition by range(colint) -(partition p0 values less than (ord('a')), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -8 -9 -select * from t22 order by col1; -col1 -3 -8 -9 -select * from t33 order by col1; -col1 -3 -8 -9 -select * from t44 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -select * from t55 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 ---------------------------- ----- some alter table begin ---------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -8 -9 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -8 -9 -alter table t55 -partition by list(colint) -subpartition by hash(ord(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -show create table t55; -Table Create Table -t55 CREATE TABLE `t55` ( - `colint` int(11) DEFAULT NULL, - `col1` char(3) DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (ord(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ -select * from t55 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (ord('a')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (ord('a')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 8 -2 9 -3 3 -4 8 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with ord(col1) -------------------------------------------------------------------------- -delete from t1 where col1='9'; -delete from t2 where col1='9'; -delete from t3 where col1='9'; -delete from t4 where col1='9'; -delete from t5 where col1='9'; -delete from t6 where col1='9'; -select * from t1 order by col1; -col1 -8 -select * from t2 order by col1; -col1 -3 -8 -select * from t3 order by col1; -col1 -3 -8 -select * from t4 order by colint; -colint col1 -1 8 -3 3 -4 8 -select * from t5 order by colint; -colint col1 -1 8 -3 3 -4 8 -insert into t1 values ('9'); -insert into t2 values ('9'); -insert into t3 values ('9'); -insert into t4 values (60,'9'); -insert into t5 values (60,'9'); -insert into t6 values (60,'9'); -select * from t1 order by col1; -col1 -8 -9 -select * from t2 order by col1; -col1 -3 -8 -9 -select * from t3 order by col1; -col1 -3 -8 -9 -select * from t4 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t5 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t6 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -8 -9 -select * from t2 order by col1; -col1 -3 -8 -9 -select * from t3 order by col1; -col1 -3 -8 -9 -select * from t4 order by colint; -colint col1 -60 9 -select * from t5 order by colint; -colint col1 -60 9 -select * from t6 order by colint; -colint col1 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with ord(col1) -------------------------------------------------------------------------- -delete from t11 where col1='9'; -delete from t22 where col1='9'; -delete from t33 where col1='9'; -delete from t44 where col1='9'; -delete from t55 where col1='9'; -delete from t66 where col1='9'; -select * from t11 order by col1; -col1 -8 -select * from t22 order by col1; -col1 -3 -8 -select * from t33 order by col1; -col1 -3 -8 -select * from t44 order by colint; -colint col1 -1 8 -3 3 -4 8 -select * from t55 order by colint; -colint col1 -1 8 -3 3 -4 8 -insert into t11 values ('9'); -insert into t22 values ('9'); -insert into t33 values ('9'); -insert into t44 values (60,'9'); -insert into t55 values (60,'9'); -insert into t66 values (60,'9'); -select * from t11 order by col1; -col1 -8 -9 -select * from t22 order by col1; -col1 -3 -8 -9 -select * from t33 order by col1; -col1 -3 -8 -9 -select * from t44 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t55 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -select * from t66 order by colint; -colint col1 -1 8 -3 3 -4 8 -60 9 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -8 -9 -select * from t22 order by col1; -col1 -3 -8 -9 -select * from t33 order by col1; -col1 -3 -8 -9 -select * from t44 order by colint; -colint col1 -60 9 -select * from t55 order by colint; -colint col1 -60 9 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 select * from t66 order by colint; colint col1 +1 15 +2 13 +3 15 +4 17 +5 23 +6 34 +7 56 +8 56 +9 45 +10 34 +11 78 +12 89 +13 67 +14 46 +15 34 +16 324 +17 345 +18 34 +19 78 +20 567 +21 4 +22 435 +23 34 +24 45 +25 4565 +26 4 +27 3 +28 2 +29 3 +30 15 +31 6 +32 8 +33 9 +34 745 +35 34 +36 34 +37 324 +38 67 +39 78 +40 89 +41 90 +42 78967 +50 56 +51 34 +55 123 +60 19 ------------------------- ---- some alter table end ------------------------- @@ -4201,14 +2447,12 @@ subpartition by hash(day(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 date) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(day(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 date) engine='NDB' partition by range(colint) @@ -4225,9 +2469,9 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-02-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-01-25'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select day(col1) from t1 order by col1; day(col1) 17 @@ -4338,14 +2582,12 @@ subpartition by hash(day(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(day(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -4386,81 +2628,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-01-17 -2006-02-05 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-01-17 -2006-02-05 alter table t55 -partition by list(colint) -subpartition by hash(day(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(day(col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (day(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (day(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 2006-02-05 2 2006-01-17 3 2006-01-25 4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-05 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (day('2006-12-21')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-05 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-05 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (day('2006-12-21')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-05 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with day(col1) ------------------------------------------------------------------------- @@ -4529,32 +2714,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-01-17 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -2006-01-17 -select * from t2 order by col1; -col1 -2006-01-17 -2006-01-25 -select * from t3 order by col1; -col1 -2006-01-17 -2006-01-25 -2006-02-05 -select * from t4 order by colint; -colint col1 -60 2006-01-17 -select * from t5 order by colint; -colint col1 -60 2006-01-17 -select * from t6 order by colint; -colint col1 -60 2006-01-17 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with day(col1) ------------------------------------------------------------------------- @@ -4623,32 +2782,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-01-17 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -2006-01-17 -select * from t22 order by col1; -col1 -2006-01-17 -2006-01-25 -select * from t33 order by col1; -col1 -2006-01-17 -2006-01-25 -2006-02-05 -select * from t44 order by colint; -colint col1 -60 2006-01-17 -select * from t55 order by colint; -colint col1 -60 2006-01-17 -select * from t66 order by colint; -colint col1 -60 2006-01-17 ------------------------- ---- some alter table end ------------------------- @@ -4697,14 +2830,12 @@ subpartition by hash(dayofmonth(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 date) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(dayofmonth(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 date) engine='NDB' partition by range(colint) @@ -4721,9 +2852,9 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-02-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-01-25'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select dayofmonth(col1) from t1 order by col1; dayofmonth(col1) 17 @@ -4834,14 +2965,12 @@ subpartition by hash(dayofmonth(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(dayofmonth(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -4882,81 +3011,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-01-17 -2006-02-05 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-01-17 -2006-02-05 alter table t55 -partition by list(colint) -subpartition by hash(dayofmonth(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(dayofmonth(col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofmonth(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofmonth(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 2006-02-05 2 2006-01-17 3 2006-01-25 4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-05 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (dayofmonth('2006-12-24')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-05 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-05 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (dayofmonth('2006-12-24')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-05 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with dayofmonth(col1) ------------------------------------------------------------------------- @@ -5025,32 +3097,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-01-17 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -2006-01-17 -select * from t2 order by col1; -col1 -2006-01-17 -2006-01-25 -select * from t3 order by col1; -col1 -2006-01-17 -2006-01-25 -2006-02-05 -select * from t4 order by colint; -colint col1 -60 2006-01-17 -select * from t5 order by colint; -colint col1 -60 2006-01-17 -select * from t6 order by colint; -colint col1 -60 2006-01-17 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with dayofmonth(col1) ------------------------------------------------------------------------- @@ -5119,32 +3165,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-01-17 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -2006-01-17 -select * from t22 order by col1; -col1 -2006-01-17 -2006-01-25 -select * from t33 order by col1; -col1 -2006-01-17 -2006-01-25 -2006-02-05 -select * from t44 order by colint; -colint col1 -60 2006-01-17 -select * from t55 order by colint; -colint col1 -60 2006-01-17 -select * from t66 order by colint; -colint col1 -60 2006-01-17 ------------------------- ---- some alter table end ------------------------- @@ -5193,14 +3213,12 @@ subpartition by hash(dayofweek(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 date) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(dayofweek(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 date) engine='NDB' partition by range(colint) @@ -5217,9 +3235,9 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-02-17'); insert into t3 values ('2006-01-25'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select dayofweek(col1) from t1 order by col1; dayofweek(col1) 3 @@ -5330,14 +3348,12 @@ subpartition by hash(dayofweek(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(dayofweek(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -5378,81 +3394,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-02-05 -2006-02-17 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-02-05 -2006-02-17 alter table t55 -partition by list(colint) -subpartition by hash(dayofweek(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(dayofweek(col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofweek(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofweek(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 2006-02-03 2 2006-01-17 3 2006-01-25 4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (dayofweek('2006-12-24')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (dayofweek('2006-12-24')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with dayofweek(col1) ------------------------------------------------------------------------- @@ -5526,33 +3485,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-02-17 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -select * from t2 order by col1; -col1 -select * from t3 order by col1; -col1 -2006-01-25 -2006-02-05 -2006-02-17 -select * from t4 order by colint; -colint col1 -60 2006-02-17 -select * from t5 order by colint; -colint col1 -60 2006-02-17 -select * from t6 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -60 2006-02-17 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with dayofweek(col1) ------------------------------------------------------------------------- @@ -5626,33 +3558,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-02-17 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -select * from t22 order by col1; -col1 -select * from t33 order by col1; -col1 -2006-01-25 -2006-02-05 -2006-02-17 -select * from t44 order by colint; -colint col1 -60 2006-02-17 -select * from t55 order by colint; -colint col1 -60 2006-02-17 -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -60 2006-02-17 ------------------------- ---- some alter table end ------------------------- @@ -5701,14 +3606,12 @@ subpartition by hash(dayofyear(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 date) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(dayofyear(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 date) engine='NDB' partition by range(colint) @@ -5725,9 +3628,9 @@ insert into t2 values ('2006-02-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-02-25'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select dayofyear(col1) from t1 order by col1; dayofyear(col1) 3 @@ -5838,14 +3741,12 @@ subpartition by hash(dayofyear(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(dayofyear(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -5886,81 +3787,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-01-17 -2006-02-05 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-01-17 -2006-02-05 alter table t55 -partition by list(colint) -subpartition by hash(dayofyear(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(dayofyear(col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofyear(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofyear(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 2006-02-03 2 2006-01-17 3 2006-01-25 4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (dayofyear('2006-12-25')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (dayofyear('2006-12-25')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with dayofyear(col1) ------------------------------------------------------------------------- @@ -6029,33 +3873,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-01-17 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -2006-01-17 -2006-02-05 -select * from t2 order by col1; -col1 -2006-01-17 -2006-02-05 -2006-02-25 -select * from t3 order by col1; -col1 -2006-01-17 -2006-02-05 -2006-02-25 -select * from t4 order by colint; -colint col1 -60 2006-01-17 -select * from t5 order by colint; -colint col1 -60 2006-01-17 -select * from t6 order by colint; -colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with dayofyear(col1) ------------------------------------------------------------------------- @@ -6124,33 +3941,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-01-17 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -2006-01-17 -2006-02-05 -select * from t22 order by col1; -col1 -2006-01-17 -2006-02-05 -2006-02-25 -select * from t33 order by col1; -col1 -2006-01-17 -2006-02-05 -2006-02-25 -select * from t44 order by colint; -colint col1 -60 2006-01-17 -select * from t55 order by colint; -colint col1 -60 2006-01-17 -select * from t66 order by colint; -colint col1 ------------------------- ---- some alter table end ------------------------- @@ -6199,14 +3989,12 @@ subpartition by hash(dayofyear(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 char(30)) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(dayofyear(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 char(30)) engine='NDB' partition by range(colint) @@ -6223,9 +4011,9 @@ insert into t2 values ('2006-02-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-02-25'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select dayofyear(col1) from t1 order by col1; dayofyear(col1) 3 @@ -6336,14 +4124,12 @@ subpartition by hash(dayofyear(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(dayofyear(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -6384,81 +4170,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-01-17 -2006-02-05 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-01-17 -2006-02-05 alter table t55 -partition by list(colint) -subpartition by hash(dayofyear(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(dayofyear(col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` char(30) DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofyear(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofyear(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 2006-02-03 2 2006-01-17 3 2006-01-25 4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (dayofyear('2006-12-25')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (dayofyear('2006-12-25')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with dayofyear(col1) ------------------------------------------------------------------------- @@ -6527,33 +4256,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-01-17 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -2006-01-17 -2006-02-05 -select * from t2 order by col1; -col1 -2006-01-17 -2006-02-05 -2006-02-25 -select * from t3 order by col1; -col1 -2006-01-17 -2006-02-05 -2006-02-25 -select * from t4 order by colint; -colint col1 -60 2006-01-17 -select * from t5 order by colint; -colint col1 -60 2006-01-17 -select * from t6 order by colint; -colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with dayofyear(col1) ------------------------------------------------------------------------- @@ -6622,33 +4324,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-01-17 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -2006-01-17 -2006-02-05 -select * from t22 order by col1; -col1 -2006-01-17 -2006-02-05 -2006-02-25 -select * from t33 order by col1; -col1 -2006-01-17 -2006-02-05 -2006-02-25 -select * from t44 order by colint; -colint col1 -60 2006-01-17 -select * from t55 order by colint; -colint col1 -60 2006-01-17 -select * from t66 order by colint; -colint col1 ------------------------- ---- some alter table end ------------------------- @@ -6697,14 +4372,12 @@ subpartition by hash(extract(month from col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 date) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(extract(month from col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 date) engine='NDB' partition by range(colint) @@ -6721,9 +4394,9 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-02-17'); insert into t3 values ('2006-01-25'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select extract(month from col1) from t1 order by col1; extract(month from col1) 1 @@ -6834,14 +4507,12 @@ subpartition by hash(extract(month from col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(extract(month from col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -6882,81 +4553,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-02-05 -2006-02-17 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-02-05 -2006-02-17 alter table t55 -partition by list(colint) -subpartition by hash(extract(month from col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(extract(month from col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (extract(month from col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (extract(month from col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 2006-02-03 2 2006-01-17 3 2006-01-25 4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (extract(year from '1998-11-23')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (extract(year from '1998-11-23')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with extract(month from col1) ------------------------------------------------------------------------- @@ -7030,28 +4644,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-02-17 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -select * from t2 order by col1; -col1 -select * from t3 order by col1; -col1 -2006-01-25 -2006-02-05 -2006-02-17 -select * from t4 order by colint; -colint col1 -60 2006-02-17 -select * from t5 order by colint; -colint col1 -60 2006-02-17 -select * from t6 order by colint; -colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with extract(month from col1) ------------------------------------------------------------------------- @@ -7125,28 +4717,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-02-17 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -select * from t22 order by col1; -col1 -select * from t33 order by col1; -col1 -2006-01-25 -2006-02-05 -2006-02-17 -select * from t44 order by colint; -colint col1 -60 2006-02-17 -select * from t55 order by colint; -colint col1 -60 2006-02-17 -select * from t66 order by colint; -colint col1 ------------------------- ---- some alter table end ------------------------- @@ -7195,14 +4765,12 @@ subpartition by hash(hour(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 time) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(hour(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 time) engine='NDB' partition by range(colint) @@ -7219,9 +4787,9 @@ insert into t2 values ('21:59'); insert into t3 values ('09:09'); insert into t3 values ('14:30'); insert into t3 values ('21:59'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6; select hour(col1) from t1 order by col1; hour(col1) 9 @@ -7332,14 +4900,12 @@ subpartition by hash(hour(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(hour(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -7380,81 +4946,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -10:30:00 -14:30:00 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -10:30:00 -14:30:00 alter table t55 -partition by list(colint) -subpartition by hash(hour(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(hour(col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` time DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (hour(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (hour(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 09:09:15 2 04:30:01 3 00:59:22 4 05:30:34 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 09:09:15 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (hour('18:30')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 09:09:15 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 09:09:15 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (hour('18:30')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 09:09:15 -2 04:30:01 -3 00:59:22 -4 05:30:34 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with hour(col1) ------------------------------------------------------------------------- @@ -7528,31 +5037,6 @@ colint col1 3 00:59:22 4 05:30:34 60 14:30:00 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -select * from t2 order by col1; -col1 -14:30:00 -21:59:00 -select * from t3 order by col1; -col1 -10:30:00 -14:30:00 -21:59:00 -select * from t4 order by colint; -colint col1 -60 14:30:00 -select * from t5 order by colint; -colint col1 -60 14:30:00 -select * from t6 order by colint; -colint col1 -60 14:30:00 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with hour(col1) ------------------------------------------------------------------------- @@ -7626,31 +5110,6 @@ colint col1 3 00:59:22 4 05:30:34 60 14:30:00 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -select * from t22 order by col1; -col1 -14:30:00 -21:59:00 -select * from t33 order by col1; -col1 -10:30:00 -14:30:00 -21:59:00 -select * from t44 order by colint; -colint col1 -60 14:30:00 -select * from t55 order by colint; -colint col1 -60 14:30:00 -select * from t66 order by colint; -colint col1 -60 14:30:00 ------------------------- ---- some alter table end ------------------------- @@ -7699,14 +5158,12 @@ subpartition by hash(microsecond(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 time) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(microsecond(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 time) engine='NDB' partition by range(colint) @@ -7723,9 +5180,9 @@ insert into t2 values ('00:59:22.000024'); insert into t3 values ('09:09:15.000002'); insert into t3 values ('04:30:01.000018'); insert into t3 values ('00:59:22.000024'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6; select microsecond(col1) from t1 order by col1; microsecond(col1) 0 @@ -7836,14 +5293,12 @@ subpartition by hash(microsecond(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(microsecond(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -7884,81 +5339,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -04:30:01 -05:30:34 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -04:30:01 -05:30:34 alter table t55 -partition by list(colint) -subpartition by hash(microsecond(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(microsecond(col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` time DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (microsecond(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (microsecond(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 05:30:34 2 04:30:01 3 00:59:22 4 05:30:34 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 05:30:34 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (microsecond('10:30:10.000010')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 05:30:34 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 05:30:34 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (microsecond('10:30:10.000010')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 05:30:34 -2 04:30:01 -3 00:59:22 -4 05:30:34 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with microsecond(col1) ------------------------------------------------------------------------- @@ -8027,29 +5425,6 @@ colint col1 3 00:59:22 4 05:30:34 60 04:30:01 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -select * from t2 order by col1; -col1 -select * from t3 order by col1; -col1 -00:59:22 -04:30:01 -05:30:34 -select * from t4 order by colint; -colint col1 -60 04:30:01 -select * from t5 order by colint; -colint col1 -60 04:30:01 -select * from t6 order by colint; -colint col1 -60 04:30:01 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with microsecond(col1) ------------------------------------------------------------------------- @@ -8118,29 +5493,6 @@ colint col1 3 00:59:22 4 05:30:34 60 04:30:01 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -select * from t22 order by col1; -col1 -select * from t33 order by col1; -col1 -00:59:22 -04:30:01 -05:30:34 -select * from t44 order by colint; -colint col1 -60 04:30:01 -select * from t55 order by colint; -colint col1 -60 04:30:01 -select * from t66 order by colint; -colint col1 -60 04:30:01 ------------------------- ---- some alter table end ------------------------- @@ -8189,14 +5541,12 @@ subpartition by hash(minute(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 time) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(minute(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 time) engine='NDB' partition by range(colint) @@ -8213,9 +5563,9 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:15'); insert into t3 values ('14:30:45'); insert into t3 values ('21:59:22'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6; select minute(col1) from t1 order by col1; minute(col1) 9 @@ -8326,14 +5676,12 @@ subpartition by hash(minute(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(minute(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -8374,81 +5722,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -10:24:23 -14:30:45 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -10:24:23 -14:30:45 alter table t55 -partition by list(colint) -subpartition by hash(minute(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(minute(col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` time DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (minute(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (minute(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 10:24:23 2 04:30:01 3 00:59:22 4 05:30:34 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 10:24:23 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (minute('18:30')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 10:24:23 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 10:24:23 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (minute('18:30')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 10:24:23 -2 04:30:01 -3 00:59:22 -4 05:30:34 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with minute(col1) ------------------------------------------------------------------------- @@ -8522,34 +5813,6 @@ colint col1 3 00:59:22 4 05:30:34 60 14:30:45 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -10:24:23 -14:30:45 -select * from t2 order by col1; -col1 -10:24:23 -14:30:45 -21:59:22 -select * from t3 order by col1; -col1 -10:24:23 -14:30:45 -21:59:22 -select * from t4 order by colint; -colint col1 -60 14:30:45 -select * from t5 order by colint; -colint col1 -60 14:30:45 -select * from t6 order by colint; -colint col1 -60 14:30:45 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with minute(col1) ------------------------------------------------------------------------- @@ -8623,34 +5886,6 @@ colint col1 3 00:59:22 4 05:30:34 60 14:30:45 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -10:24:23 -14:30:45 -select * from t22 order by col1; -col1 -10:24:23 -14:30:45 -21:59:22 -select * from t33 order by col1; -col1 -10:24:23 -14:30:45 -21:59:22 -select * from t44 order by colint; -colint col1 -60 14:30:45 -select * from t55 order by colint; -colint col1 -60 14:30:45 -select * from t66 order by colint; -colint col1 -60 14:30:45 ------------------------- ---- some alter table end ------------------------- @@ -8699,14 +5934,12 @@ subpartition by hash(second(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 time) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(second(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 time) engine='NDB' partition by range(colint) @@ -8723,9 +5956,9 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:09'); insert into t3 values ('14:30:20'); insert into t3 values ('21:59:22'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6; select second(col1) from t1 order by col1; second(col1) 9 @@ -8836,14 +6069,12 @@ subpartition by hash(second(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(second(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -8884,81 +6115,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -10:22:33 -14:30:20 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -10:22:33 -14:30:20 alter table t55 -partition by list(colint) -subpartition by hash(second(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(second(col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` time DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (second(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (second(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 09:09:15 2 04:30:01 3 00:59:22 4 05:30:34 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 09:09:15 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (second('18:30:14')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 09:09:15 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 09:09:15 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (second('18:30:14')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 09:09:15 -2 04:30:01 -3 00:59:22 -4 05:30:34 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with second(col1) ------------------------------------------------------------------------- @@ -9032,34 +6206,6 @@ colint col1 3 00:59:22 4 05:30:34 60 14:30:20 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -10:22:33 -14:30:20 -select * from t2 order by col1; -col1 -10:22:33 -14:30:20 -21:59:22 -select * from t3 order by col1; -col1 -10:22:33 -14:30:20 -21:59:22 -select * from t4 order by colint; -colint col1 -60 14:30:20 -select * from t5 order by colint; -colint col1 -60 14:30:20 -select * from t6 order by colint; -colint col1 -60 14:30:20 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with second(col1) ------------------------------------------------------------------------- @@ -9133,34 +6279,6 @@ colint col1 3 00:59:22 4 05:30:34 60 14:30:20 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -10:22:33 -14:30:20 -select * from t22 order by col1; -col1 -10:22:33 -14:30:20 -21:59:22 -select * from t33 order by col1; -col1 -10:22:33 -14:30:20 -21:59:22 -select * from t44 order by colint; -colint col1 -60 14:30:20 -select * from t55 order by colint; -colint col1 -60 14:30:20 -select * from t66 order by colint; -colint col1 -60 14:30:20 ------------------------- ---- some alter table end ------------------------- @@ -9209,14 +6327,12 @@ subpartition by hash(second(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 char(30)) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(second(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 char(30)) engine='NDB' partition by range(colint) @@ -9233,9 +6349,9 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:09'); insert into t3 values ('14:30:20'); insert into t3 values ('21:59:22'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6; select second(col1) from t1 order by col1; second(col1) 9 @@ -9346,14 +6462,12 @@ subpartition by hash(second(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(second(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -9394,81 +6508,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -10:22:33 -14:30:20 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -10:22:33 -14:30:20 alter table t55 -partition by list(colint) -subpartition by hash(second(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(second(col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` char(30) DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (second(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (second(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 09:09:15.000002 2 04:30:01.000018 3 00:59:22.000024 4 05:30:34.000037 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 09:09:15.000002 -2 04:30:01.000018 -3 00:59:22.000024 -4 05:30:34.000037 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (second('18:30:14')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 09:09:15.000002 -2 04:30:01.000018 -3 00:59:22.000024 -4 05:30:34.000037 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 09:09:15.000002 -2 04:30:01.000018 -3 00:59:22.000024 -4 05:30:34.000037 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (second('18:30:14')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 09:09:15.000002 -2 04:30:01.000018 -3 00:59:22.000024 -4 05:30:34.000037 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with second(col1) ------------------------------------------------------------------------- @@ -9542,34 +6599,6 @@ colint col1 3 00:59:22.000024 4 05:30:34.000037 60 14:30:20 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -10:22:33 -14:30:20 -select * from t2 order by col1; -col1 -10:22:33 -14:30:20 -21:59:22 -select * from t3 order by col1; -col1 -10:22:33 -14:30:20 -21:59:22 -select * from t4 order by colint; -colint col1 -60 14:30:20 -select * from t5 order by colint; -colint col1 -60 14:30:20 -select * from t6 order by colint; -colint col1 -60 14:30:20 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with second(col1) ------------------------------------------------------------------------- @@ -9643,34 +6672,6 @@ colint col1 3 00:59:22.000024 4 05:30:34.000037 60 14:30:20 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -10:22:33 -14:30:20 -select * from t22 order by col1; -col1 -10:22:33 -14:30:20 -21:59:22 -select * from t33 order by col1; -col1 -10:22:33 -14:30:20 -21:59:22 -select * from t44 order by colint; -colint col1 -60 14:30:20 -select * from t55 order by colint; -colint col1 -60 14:30:20 -select * from t66 order by colint; -colint col1 -60 14:30:20 ------------------------- ---- some alter table end ------------------------- @@ -9719,14 +6720,12 @@ subpartition by hash(month(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 date) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(month(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 date) engine='NDB' partition by range(colint) @@ -9743,9 +6742,9 @@ insert into t2 values ('2006-05-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-12-17'); insert into t3 values ('2006-05-25'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select month(col1) from t1 order by col1; month(col1) 1 @@ -9856,14 +6855,12 @@ subpartition by hash(month(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(month(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -9904,81 +6901,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-11-06 -2006-12-17 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-11-06 -2006-12-17 alter table t55 -partition by list(colint) -subpartition by hash(month(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(month(col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (month(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (month(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 2006-02-03 2 2006-01-17 3 2006-01-25 4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (month('2006-10-14')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (month('2006-10-14')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with month(col1) ------------------------------------------------------------------------- @@ -10052,31 +6992,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-12-17 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -select * from t2 order by col1; -col1 -2006-11-06 -2006-12-17 -select * from t3 order by col1; -col1 -2006-05-25 -2006-11-06 -2006-12-17 -select * from t4 order by colint; -colint col1 -60 2006-12-17 -select * from t5 order by colint; -colint col1 -60 2006-12-17 -select * from t6 order by colint; -colint col1 -60 2006-12-17 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with month(col1) ------------------------------------------------------------------------- @@ -10150,31 +7065,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-12-17 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -select * from t22 order by col1; -col1 -2006-11-06 -2006-12-17 -select * from t33 order by col1; -col1 -2006-05-25 -2006-11-06 -2006-12-17 -select * from t44 order by colint; -colint col1 -60 2006-12-17 -select * from t55 order by colint; -colint col1 -60 2006-12-17 -select * from t66 order by colint; -colint col1 -60 2006-12-17 ------------------------- ---- some alter table end ------------------------- @@ -10223,14 +7113,12 @@ subpartition by hash(quarter(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 date) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(quarter(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 date) engine='NDB' partition by range(colint) @@ -10247,9 +7135,9 @@ insert into t2 values ('2006-09-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-12-17'); insert into t3 values ('2006-09-25'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select quarter(col1) from t1 order by col1; quarter(col1) 1 @@ -10360,14 +7248,12 @@ subpartition by hash(quarter(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(quarter(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -10408,81 +7294,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-07-30 -2006-12-17 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-07-30 -2006-12-17 alter table t55 -partition by list(colint) -subpartition by hash(quarter(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(quarter(col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (quarter(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (quarter(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 2006-02-03 2 2006-01-17 3 2006-01-25 4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (quarter('2006-10-14')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (quarter('2006-10-14')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with quarter(col1) ------------------------------------------------------------------------- @@ -10556,30 +7385,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-12-17 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -select * from t2 order by col1; -col1 -select * from t3 order by col1; -col1 -2006-07-30 -2006-09-25 -2006-12-17 -select * from t4 order by colint; -colint col1 -60 2006-12-17 -select * from t5 order by colint; -colint col1 -60 2006-12-17 -select * from t6 order by colint; -colint col1 -4 2006-02-05 -60 2006-12-17 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with quarter(col1) ------------------------------------------------------------------------- @@ -10653,30 +7458,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-12-17 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -select * from t22 order by col1; -col1 -select * from t33 order by col1; -col1 -2006-07-30 -2006-09-25 -2006-12-17 -select * from t44 order by colint; -colint col1 -60 2006-12-17 -select * from t55 order by colint; -colint col1 -60 2006-12-17 -select * from t66 order by colint; -colint col1 -4 2006-02-05 -60 2006-12-17 ------------------------- ---- some alter table end ------------------------- @@ -10725,14 +7506,12 @@ subpartition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 time) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 time) engine='NDB' partition by range(colint) @@ -10749,9 +7528,9 @@ insert into t2 values ('21:59:22'); insert into t3 values ('09:09:15'); insert into t3 values ('14:30:45'); insert into t3 values ('21:59:22'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6; select time_to_sec(col1)-(time_to_sec(col1)-20) from t1 order by col1; time_to_sec(col1)-(time_to_sec(col1)-20) 20 @@ -10862,14 +7641,12 @@ subpartition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -10910,81 +7687,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -10:33:11 -14:30:45 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -10:33:11 -14:30:45 alter table t55 -partition by list(colint) -subpartition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` time DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (time_to_sec(col1)-(time_to_sec(col1)-20)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (time_to_sec(col1)-(time_to_sec(col1)-20)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 10:33:11 2 04:30:01 3 00:59:22 4 05:30:34 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 10:33:11 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (time_to_sec('18:30:14')-(time_to_sec('17:59:59'))), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 10:33:11 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 10:33:11 -2 04:30:01 -3 00:59:22 -4 05:30:34 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (time_to_sec('18:30:14')-(time_to_sec('17:59:59'))), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 10:33:11 -2 04:30:01 -3 00:59:22 -4 05:30:34 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with time_to_sec(col1)-(time_to_sec(col1)-20) ------------------------------------------------------------------------- @@ -11058,33 +7778,6 @@ colint col1 3 00:59:22 4 05:30:34 60 14:30:45 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -10:33:11 -14:30:45 -select * from t2 order by col1; -col1 -10:33:11 -14:30:45 -21:59:22 -select * from t3 order by col1; -col1 -10:33:11 -14:30:45 -21:59:22 -select * from t4 order by colint; -colint col1 -60 14:30:45 -select * from t5 order by colint; -colint col1 -60 14:30:45 -select * from t6 order by colint; -colint col1 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with time_to_sec(col1)-(time_to_sec(col1)-20) ------------------------------------------------------------------------- @@ -11158,33 +7851,6 @@ colint col1 3 00:59:22 4 05:30:34 60 14:30:45 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -10:33:11 -14:30:45 -select * from t22 order by col1; -col1 -10:33:11 -14:30:45 -21:59:22 -select * from t33 order by col1; -col1 -10:33:11 -14:30:45 -21:59:22 -select * from t44 order by colint; -colint col1 -60 14:30:45 -select * from t55 order by colint; -colint col1 -60 14:30:45 -select * from t66 order by colint; -colint col1 ------------------------- ---- some alter table end ------------------------- @@ -11233,14 +7899,12 @@ subpartition by hash(to_days(col1)-to_days('2006-01-01')) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 date) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(to_days(col1)-to_days('2006-01-01')) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 date) engine='NDB' partition by range(colint) @@ -11257,9 +7921,9 @@ insert into t2 values ('2006-01-25'); insert into t3 values ('2006-02-03'); insert into t3 values ('2006-01-17'); insert into t3 values ('2006-01-25'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select to_days(col1)-to_days('2006-01-01') from t1 order by col1; to_days(col1)-to_days('2006-01-01') 16 @@ -11370,14 +8034,12 @@ subpartition by hash(to_days(col1)-to_days('2006-01-01')) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(to_days(col1)-to_days('2006-01-01')) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -11418,81 +8080,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-01-17 -2006-02-06 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-01-17 -2006-02-06 alter table t55 -partition by list(colint) -subpartition by hash(to_days(col1)-to_days('2006-01-01')) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(to_days(col1)-to_days('2006-01-01')) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (to_days(col1)-to_days('2006-01-01')) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (to_days(col1)-to_days('2006-01-01')) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 2006-02-06 2 2006-01-17 3 2006-01-25 4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-06 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (to_days('2006-02-02')-to_days('2006-01-01')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-06 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-06 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (to_days('2006-02-02')-to_days('2006-01-01')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-06 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with to_days(col1)-to_days('2006-01-01') ------------------------------------------------------------------------- @@ -11561,34 +8166,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-01-17 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -2006-01-17 -2006-02-06 -select * from t2 order by col1; -col1 -2006-01-17 -2006-01-25 -2006-02-06 -select * from t3 order by col1; -col1 -2006-01-17 -2006-01-25 -2006-02-06 -select * from t4 order by colint; -colint col1 -60 2006-01-17 -select * from t5 order by colint; -colint col1 -60 2006-01-17 -select * from t6 order by colint; -colint col1 -60 2006-01-17 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with to_days(col1)-to_days('2006-01-01') ------------------------------------------------------------------------- @@ -11657,11 +8234,200 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-01-17 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; +------------------------- +---- some alter table end +------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +------------------------------------------------------------------------- +--- datediff(col1, '2006-01-01') in partition with coltype date +------------------------------------------------------------------------- +drop table if exists t1 ; +drop table if exists t2 ; +drop table if exists t3 ; +drop table if exists t4 ; +drop table if exists t5 ; +drop table if exists t6 ; +------------------------------------------------------------------------- +--- Create tables with datediff(col1, '2006-01-01') +------------------------------------------------------------------------- +create table t1 (col1 date) engine='NDB' +partition by range(datediff(col1, '2006-01-01')) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t2 (col1 date) engine='NDB' +partition by list(datediff(col1, '2006-01-01')) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +create table t3 (col1 date) engine='NDB' +partition by hash(datediff(col1, '2006-01-01')); +create table t4 (colint int, col1 date) engine='NDB' +partition by range(colint) +subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +create table t5 (colint int, col1 date) engine='NDB' +partition by list(colint) +subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) +); +create table t6 (colint int, col1 date) engine='NDB' +partition by range(colint) +(partition p0 values less than (datediff('2006-02-02', '2006-01-01')), +partition p1 values less than maxvalue); +------------------------------------------------------------------------- +--- Access tables with datediff(col1, '2006-01-01') +------------------------------------------------------------------------- +insert into t1 values ('2006-02-03'); +insert into t1 values ('2006-01-17'); +insert into t2 values ('2006-02-03'); +insert into t2 values ('2006-01-17'); +insert into t2 values ('2006-01-25'); +insert into t3 values ('2006-02-03'); +insert into t3 values ('2006-01-17'); +insert into t3 values ('2006-01-25'); +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; +select datediff(col1, '2006-01-01') from t1 order by col1; +datediff(col1, '2006-01-01') +16 +33 +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-03 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-03 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-03 +select * from t4 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-03 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +update t1 set col1='2006-02-06' where col1='2006-02-03'; +update t2 set col1='2006-02-06' where col1='2006-02-03'; +update t3 set col1='2006-02-06' where col1='2006-02-03'; +update t4 set col1='2006-02-06' where col1='2006-02-03'; +update t5 set col1='2006-02-06' where col1='2006-02-03'; +update t6 set col1='2006-02-06' where col1='2006-02-03'; +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t4 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t6 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Alter tables with datediff(col1, '2006-01-01') +------------------------------------------------------------------------- +drop table if exists t11 ; +drop table if exists t22 ; +drop table if exists t33 ; +drop table if exists t44 ; +drop table if exists t55 ; +drop table if exists t66 ; +create table t11 engine='NDB' as select * from t1; +create table t22 engine='NDB' as select * from t2; +create table t33 engine='NDB' as select * from t3; +create table t44 engine='NDB' as select * from t4; +create table t55 engine='NDB' as select * from t5; +create table t66 engine='NDB' as select * from t6; +alter table t11 +partition by range(datediff(col1, '2006-01-01')) +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t22 +partition by list(datediff(col1, '2006-01-01')) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), +partition p1 values in (11,12,13,14,15,16,17,18,19,20), +partition p2 values in (21,22,23,24,25,26,27,28,29,30), +partition p3 values in (31,32,33,34,35,36,37,38,39,40), +partition p4 values in (41,42,43,44,45,46,47,48,49,50), +partition p5 values in (51,52,53,54,55,56,57,58,59,60) +); +alter table t33 +partition by hash(datediff(col1, '2006-01-01')); +alter table t44 +partition by range(colint) +subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2 +(partition p0 values less than (15), +partition p1 values less than maxvalue); +alter table t55 +partition by list(colint) +subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) +); +alter table t66 +partition by range(colint) +(partition p0 values less than (datediff('2006-02-02', '2006-01-01')), +partition p1 values less than maxvalue); select * from t11 order by col1; col1 2006-01-17 @@ -11678,12 +8444,178 @@ col1 2006-02-06 select * from t44 order by colint; colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +select * from t66 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +--------------------------- +---- some alter table begin +--------------------------- +alter table t55 +partition by list(colint) +subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) +); +show create table t55; +Table Create Table +t55 CREATE TABLE `t55` ( + `colint` int(11) DEFAULT NULL, + `col1` date DEFAULT NULL +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (datediff(col1, '2006-01-01')) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ +select * from t55 order by colint; +colint col1 +1 2006-02-06 +2 2006-01-17 +3 2006-01-25 +4 2006-02-05 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with datediff(col1, '2006-01-01') +------------------------------------------------------------------------- +delete from t1 where col1='2006-01-17'; +delete from t2 where col1='2006-01-17'; +delete from t3 where col1='2006-01-17'; +delete from t4 where col1='2006-01-17'; +delete from t5 where col1='2006-01-17'; +delete from t6 where col1='2006-01-17'; +select * from t1 order by col1; +col1 +2006-02-06 +select * from t2 order by col1; +col1 +2006-01-25 +2006-02-06 +select * from t3 order by col1; +col1 +2006-01-25 +2006-02-06 +select * from t4 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +select * from t5 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +insert into t1 values ('2006-01-17'); +insert into t2 values ('2006-01-17'); +insert into t3 values ('2006-01-17'); +insert into t4 values (60,'2006-01-17'); +insert into t5 values (60,'2006-01-17'); +insert into t6 values (60,'2006-01-17'); +select * from t1 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t2 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t3 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t4 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t5 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +select * from t6 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +60 2006-01-17 +------------------------------------------------------------------------- +--- Delete rows and partitions of tables with datediff(col1, '2006-01-01') +------------------------------------------------------------------------- +delete from t11 where col1='2006-01-17'; +delete from t22 where col1='2006-01-17'; +delete from t33 where col1='2006-01-17'; +delete from t44 where col1='2006-01-17'; +delete from t55 where col1='2006-01-17'; +delete from t66 where col1='2006-01-17'; +select * from t11 order by col1; +col1 +2006-02-06 +select * from t22 order by col1; +col1 +2006-01-25 +2006-02-06 +select * from t33 order by col1; +col1 +2006-01-25 +2006-02-06 +select * from t44 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +select * from t55 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 +insert into t11 values ('2006-01-17'); +insert into t22 values ('2006-01-17'); +insert into t33 values ('2006-01-17'); +insert into t44 values (60,'2006-01-17'); +insert into t55 values (60,'2006-01-17'); +insert into t66 values (60,'2006-01-17'); +select * from t11 order by col1; +col1 +2006-01-17 +2006-02-06 +select * from t22 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t33 order by col1; +col1 +2006-01-17 +2006-01-25 +2006-02-06 +select * from t44 order by colint; +colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 60 2006-01-17 select * from t55 order by colint; colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 60 2006-01-17 select * from t66 order by colint; colint col1 +1 2006-02-06 +3 2006-01-25 +4 2006-02-05 60 2006-01-17 ------------------------- ---- some alter table end @@ -11733,14 +8665,12 @@ subpartition by hash(weekday(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 date) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(weekday(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 date) engine='NDB' partition by range(colint) @@ -11757,9 +8687,9 @@ insert into t2 values ('2006-05-25'); insert into t3 values ('2006-12-03'); insert into t3 values ('2006-11-17'); insert into t3 values ('2006-05-25'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select weekday(col1) from t1 order by col1; weekday(col1) 4 @@ -11870,14 +8800,12 @@ subpartition by hash(weekday(col1)) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(weekday(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -11918,81 +8846,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-02-06 -2006-11-17 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-02-06 -2006-11-17 alter table t55 -partition by list(colint) -subpartition by hash(weekday(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(weekday(col1)) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (weekday(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (weekday(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 2006-02-03 2 2006-01-17 3 2006-01-25 4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (weekday('2006-10-14')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (weekday('2006-10-14')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with weekday(col1) ------------------------------------------------------------------------- @@ -12066,29 +8937,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-11-17 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -select * from t2 order by col1; -col1 -select * from t3 order by col1; -col1 -2006-02-06 -2006-05-25 -2006-11-17 -select * from t4 order by colint; -colint col1 -60 2006-11-17 -select * from t5 order by colint; -colint col1 -60 2006-11-17 -select * from t6 order by colint; -colint col1 -60 2006-11-17 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with weekday(col1) ------------------------------------------------------------------------- @@ -12162,537 +9010,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-11-17 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -select * from t22 order by col1; -col1 -select * from t33 order by col1; -col1 -2006-02-06 -2006-05-25 -2006-11-17 -select * from t44 order by colint; -colint col1 -60 2006-11-17 -select * from t55 order by colint; -colint col1 -60 2006-11-17 -select * from t66 order by colint; -colint col1 -60 2006-11-17 -------------------------- ----- some alter table end -------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -------------------------------------------------------------------------- ---- weekofyear(col1) in partition with coltype date -------------------------------------------------------------------------- -drop table if exists t1 ; -drop table if exists t2 ; -drop table if exists t3 ; -drop table if exists t4 ; -drop table if exists t5 ; -drop table if exists t6 ; -------------------------------------------------------------------------- ---- Create tables with weekofyear(col1) -------------------------------------------------------------------------- -create table t1 (col1 date) engine='NDB' -partition by range(weekofyear(col1)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t2 (col1 date) engine='NDB' -partition by list(weekofyear(col1)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t3 (col1 date) engine='NDB' -partition by hash(weekofyear(col1)); -create table t4 (colint int, col1 date) engine='NDB' -partition by range(colint) -subpartition by hash(weekofyear(col1)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -create table t5 (colint int, col1 date) engine='NDB' -partition by list(colint) -subpartition by hash(weekofyear(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -create table t6 (colint int, col1 date) engine='NDB' -partition by range(colint) -(partition p0 values less than (weekofyear('2006-02-14')), -partition p1 values less than maxvalue); -------------------------------------------------------------------------- ---- Access tables with weekofyear(col1) -------------------------------------------------------------------------- -insert into t1 values ('2006-01-03'); -insert into t1 values ('2006-03-17'); -insert into t2 values ('2006-01-03'); -insert into t2 values ('2006-03-17'); -insert into t2 values ('2006-05-25'); -insert into t3 values ('2006-01-03'); -insert into t3 values ('2006-03-17'); -insert into t3 values ('2006-05-25'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; -select weekofyear(col1) from t1 order by col1; -weekofyear(col1) -1 -11 -select * from t1 order by col1; -col1 -2006-01-03 -2006-03-17 -select * from t2 order by col1; -col1 -2006-01-03 -2006-03-17 -2006-05-25 -select * from t3 order by col1; -col1 -2006-01-03 -2006-03-17 -2006-05-25 -select * from t4 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t5 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t6 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -update t1 set col1='2006-09-06' where col1='2006-01-03'; -update t2 set col1='2006-09-06' where col1='2006-01-03'; -update t3 set col1='2006-09-06' where col1='2006-01-03'; -update t4 set col1='2006-09-06' where col1='2006-01-03'; -update t5 set col1='2006-09-06' where col1='2006-01-03'; -update t6 set col1='2006-09-06' where col1='2006-01-03'; -select * from t1 order by col1; -col1 -2006-03-17 -2006-09-06 -select * from t2 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t3 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t4 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t5 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t6 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -------------------------------------------------------------------------- ---- Alter tables with weekofyear(col1) -------------------------------------------------------------------------- -drop table if exists t11 ; -drop table if exists t22 ; -drop table if exists t33 ; -drop table if exists t44 ; -drop table if exists t55 ; -drop table if exists t66 ; -create table t11 engine='NDB' as select * from t1; -create table t22 engine='NDB' as select * from t2; -create table t33 engine='NDB' as select * from t3; -create table t44 engine='NDB' as select * from t4; -create table t55 engine='NDB' as select * from t5; -create table t66 engine='NDB' as select * from t6; -alter table t11 -partition by range(weekofyear(col1)) -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t22 -partition by list(weekofyear(col1)) -(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t33 -partition by hash(weekofyear(col1)); -alter table t44 -partition by range(colint) -subpartition by hash(weekofyear(col1)) subpartitions 2 -(partition p0 values less than (15), -partition p1 values less than maxvalue); -alter table t55 -partition by list(colint) -subpartition by hash(weekofyear(col1)) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -alter table t66 -partition by range(colint) -(partition p0 values less than (weekofyear('2006-02-14')), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-03-17 -2006-09-06 -select * from t22 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t33 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t44 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t55 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 ---------------------------- ----- some alter table begin ---------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-03-17 -2006-09-06 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-03-17 -2006-09-06 -alter table t55 -partition by list(colint) -subpartition by hash(weekofyear(col1)) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) -); -show create table t55; -Table Create Table -t55 CREATE TABLE `t55` ( - `colint` int(11) DEFAULT NULL, - `col1` date DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (weekofyear(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ -select * from t55 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (weekofyear('2006-02-14')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (weekofyear('2006-02-14')), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with weekofyear(col1) -------------------------------------------------------------------------- -delete from t1 where col1='2006-03-17'; -delete from t2 where col1='2006-03-17'; -delete from t3 where col1='2006-03-17'; -delete from t4 where col1='2006-03-17'; -delete from t5 where col1='2006-03-17'; -delete from t6 where col1='2006-03-17'; -select * from t1 order by col1; -col1 -2006-09-06 -select * from t2 order by col1; -col1 -2006-05-25 -2006-09-06 -select * from t3 order by col1; -col1 -2006-05-25 -2006-09-06 -select * from t4 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t5 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -insert into t1 values ('2006-03-17'); -insert into t2 values ('2006-03-17'); -insert into t3 values ('2006-03-17'); -insert into t4 values (60,'2006-03-17'); -insert into t5 values (60,'2006-03-17'); -insert into t6 values (60,'2006-03-17'); -select * from t1 order by col1; -col1 -2006-03-17 -2006-09-06 -select * from t2 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t3 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t4 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -60 2006-03-17 -select * from t5 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -60 2006-03-17 -select * from t6 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -60 2006-03-17 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -2006-09-06 -select * from t2 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t3 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t4 order by colint; -colint col1 -60 2006-03-17 -select * from t5 order by colint; -colint col1 -60 2006-03-17 -select * from t6 order by colint; -colint col1 -60 2006-03-17 -------------------------------------------------------------------------- ---- Delete rows and partitions of tables with weekofyear(col1) -------------------------------------------------------------------------- -delete from t11 where col1='2006-03-17'; -delete from t22 where col1='2006-03-17'; -delete from t33 where col1='2006-03-17'; -delete from t44 where col1='2006-03-17'; -delete from t55 where col1='2006-03-17'; -delete from t66 where col1='2006-03-17'; -select * from t11 order by col1; -col1 -2006-09-06 -select * from t22 order by col1; -col1 -2006-05-25 -2006-09-06 -select * from t33 order by col1; -col1 -2006-05-25 -2006-09-06 -select * from t44 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -select * from t55 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -insert into t11 values ('2006-03-17'); -insert into t22 values ('2006-03-17'); -insert into t33 values ('2006-03-17'); -insert into t44 values (60,'2006-03-17'); -insert into t55 values (60,'2006-03-17'); -insert into t66 values (60,'2006-03-17'); -select * from t11 order by col1; -col1 -2006-03-17 -2006-09-06 -select * from t22 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t33 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t44 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -60 2006-03-17 -select * from t55 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -60 2006-03-17 -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -60 2006-03-17 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -2006-09-06 -select * from t22 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t33 order by col1; -col1 -2006-03-17 -2006-05-25 -2006-09-06 -select * from t44 order by colint; -colint col1 -60 2006-03-17 -select * from t55 order by colint; -colint col1 -60 2006-03-17 -select * from t66 order by colint; -colint col1 -60 2006-03-17 ------------------------- ---- some alter table end ------------------------- @@ -12741,14 +9058,12 @@ subpartition by hash(year(col1)-1990) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 date) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(year(col1)-1990) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 date) engine='NDB' partition by range(colint) @@ -12765,9 +9080,9 @@ insert into t2 values ('2004-05-25'); insert into t3 values ('1996-01-03'); insert into t3 values ('2000-02-17'); insert into t3 values ('2004-05-25'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select year(col1)-1990 from t1 order by col1; year(col1)-1990 6 @@ -12878,14 +9193,12 @@ subpartition by hash(year(col1)-1990) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(year(col1)-1990) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -12926,81 +9239,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -2000-02-17 -2002-02-15 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2000-02-17 -2002-02-15 alter table t55 -partition by list(colint) -subpartition by hash(year(col1)-1990) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(year(col1)-1990) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (year(col1)-1990) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (year(col1)-1990) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 2006-02-03 2 2006-01-17 3 2006-01-25 4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (year('2005-10-14')-1990), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (year('2005-10-14')-1990), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with year(col1)-1990 ------------------------------------------------------------------------- @@ -13074,31 +9330,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2000-02-17 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -select * from t2 order by col1; -col1 -2002-02-15 -2004-05-25 -select * from t3 order by col1; -col1 -2000-02-17 -2002-02-15 -2004-05-25 -select * from t4 order by colint; -colint col1 -60 2000-02-17 -select * from t5 order by colint; -colint col1 -60 2000-02-17 -select * from t6 order by colint; -colint col1 -60 2000-02-17 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with year(col1)-1990 ------------------------------------------------------------------------- @@ -13172,31 +9403,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2000-02-17 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -select * from t22 order by col1; -col1 -2002-02-15 -2004-05-25 -select * from t33 order by col1; -col1 -2000-02-17 -2002-02-15 -2004-05-25 -select * from t44 order by colint; -colint col1 -60 2000-02-17 -select * from t55 order by colint; -colint col1 -60 2000-02-17 -select * from t66 order by colint; -colint col1 -60 2000-02-17 ------------------------- ---- some alter table end ------------------------- @@ -13245,14 +9451,12 @@ subpartition by hash(yearweek(col1)-200600) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); create table t5 (colint int, col1 date) engine='NDB' -partition by list(colint) +partition by list(colint) subpartition by hash(yearweek(col1)-200600) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); create table t6 (colint int, col1 date) engine='NDB' partition by range(colint) @@ -13269,9 +9473,9 @@ insert into t2 values ('2006-03-25'); insert into t3 values ('2006-01-03'); insert into t3 values ('2006-08-17'); insert into t3 values ('2006-03-25'); -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5; -load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5; +load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6; select yearweek(col1)-200600 from t1 order by col1; yearweek(col1)-200600 1 @@ -13382,14 +9586,12 @@ subpartition by hash(yearweek(col1)-200600) subpartitions 2 (partition p0 values less than (15), partition p1 values less than maxvalue); alter table t55 -partition by list(colint) +partition by list(colint) subpartition by hash(yearweek(col1)-200600) subpartitions 2 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15), +partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45), +partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); alter table t66 partition by range(colint) @@ -13430,81 +9632,24 @@ colint col1 --------------------------- ---- some alter table begin --------------------------- -alter table t11 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-08-17 -2006-11-15 -alter table t11 -reorganize partition s1 into -(partition p0 values less than (15), -partition p1 values less than maxvalue); -select * from t11 order by col1; -col1 -2006-08-17 -2006-11-15 alter table t55 -partition by list(colint) -subpartition by hash(yearweek(col1)-200600) subpartitions 5 -(partition p0 values in (1,2,3,4,5,6,7,8,9,10), -partition p1 values in (11,12,13,14,15,16,17,18,19,20), -partition p2 values in (21,22,23,24,25,26,27,28,29,30), -partition p3 values in (31,32,33,34,35,36,37,38,39,40), -partition p4 values in (41,42,43,44,45,46,47,48,49,50), -partition p5 values in (51,52,53,54,55,56,57,58,59,60) +partition by list(colint) +subpartition by hash(yearweek(col1)-200600) subpartitions 4 +(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30), +partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ); show create table t55; Table Create Table t55 CREATE TABLE `t55` ( `colint` int(11) DEFAULT NULL, `col1` date DEFAULT NULL -) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (yearweek(col1)-200600) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (yearweek(col1)-200600) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */ select * from t55 order by colint; colint col1 1 2006-02-03 2 2006-01-17 3 2006-01-25 4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (yearweek('2006-10-14')-200600), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition p0,p1 into -(partition s1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 -alter table t66 -reorganize partition s1 into -(partition p0 values less than (yearweek('2006-10-14')-200600), -partition p1 values less than maxvalue); -select * from t66 order by colint; -colint col1 -1 2006-02-03 -2 2006-01-17 -3 2006-01-25 -4 2006-02-05 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with yearweek(col1)-200600 ------------------------------------------------------------------------- @@ -13578,34 +9723,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-08-17 -alter table t1 drop partition p0; -alter table t2 drop partition p0; -alter table t4 drop partition p0; -alter table t5 drop partition p0; -alter table t6 drop partition p0; -select * from t1 order by col1; -col1 -2006-08-17 -2006-11-15 -select * from t2 order by col1; -col1 -2006-03-25 -2006-08-17 -2006-11-15 -select * from t3 order by col1; -col1 -2006-03-25 -2006-08-17 -2006-11-15 -select * from t4 order by colint; -colint col1 -60 2006-08-17 -select * from t5 order by colint; -colint col1 -60 2006-08-17 -select * from t6 order by colint; -colint col1 -60 2006-08-17 ------------------------------------------------------------------------- --- Delete rows and partitions of tables with yearweek(col1)-200600 ------------------------------------------------------------------------- @@ -13679,34 +9796,6 @@ colint col1 3 2006-01-25 4 2006-02-05 60 2006-08-17 -alter table t11 drop partition p0; -alter table t22 drop partition p0; -alter table t44 drop partition p0; -alter table t55 drop partition p0; -alter table t66 drop partition p0; -select * from t11 order by col1; -col1 -2006-08-17 -2006-11-15 -select * from t22 order by col1; -col1 -2006-03-25 -2006-08-17 -2006-11-15 -select * from t33 order by col1; -col1 -2006-03-25 -2006-08-17 -2006-11-15 -select * from t44 order by colint; -colint col1 -60 2006-08-17 -select * from t55 order by colint; -colint col1 -60 2006-08-17 -select * from t66 order by colint; -colint col1 -60 2006-08-17 ------------------------- ---- some alter table end ------------------------- diff --git a/mysql-test/suite/parts/r/partition_alter1_1_innodb.result b/mysql-test/suite/parts/r/partition_alter1_1_innodb.result index ec67ff8a49a..68acfcc3a60 100644 --- a/mysql-test/suite/parts/r/partition_alter1_1_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter1_1_innodb.result @@ -196,8 +196,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -355,8 +355,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -3829,8 +3829,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -7776,8 +7776,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -11836,8 +11836,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -15911,8 +15911,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; diff --git a/mysql-test/suite/parts/r/partition_alter1_1_myisam.result b/mysql-test/suite/parts/r/partition_alter1_1_myisam.result index 69b8067d043..98fa8fdfe61 100644 --- a/mysql-test/suite/parts/r/partition_alter1_1_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter1_1_myisam.result @@ -196,8 +196,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -3914,8 +3914,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -8145,8 +8145,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; diff --git a/mysql-test/suite/parts/r/partition_alter1_2_innodb.result b/mysql-test/suite/parts/r/partition_alter1_2_innodb.result index c978af2c0d9..685b9909553 100644 --- a/mysql-test/suite/parts/r/partition_alter1_2_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter1_2_innodb.result @@ -3146,8 +3146,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -6677,8 +6677,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -10320,8 +10320,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; diff --git a/mysql-test/suite/parts/r/partition_alter1_2_myisam.result b/mysql-test/suite/parts/r/partition_alter1_2_myisam.result index 23f32a715b4..31d6d4f54f6 100644 --- a/mysql-test/suite/parts/r/partition_alter1_2_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter1_2_myisam.result @@ -3389,8 +3389,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; diff --git a/mysql-test/suite/parts/r/partition_alter2_innodb.result b/mysql-test/suite/parts/r/partition_alter2_innodb.result index 15de39a3f9f..7000cb7e7ae 100644 --- a/mysql-test/suite/parts/r/partition_alter2_innodb.result +++ b/mysql-test/suite/parts/r/partition_alter2_innodb.result @@ -3259,8 +3259,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -7171,8 +7171,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -11118,8 +11118,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -15178,8 +15178,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -19253,8 +19253,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -22969,8 +22969,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -30538,8 +30538,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -38430,8 +38430,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -46435,8 +46435,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -54583,8 +54583,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -62386,8 +62386,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -66309,8 +66309,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -70268,8 +70268,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -74340,8 +74340,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -78427,8 +78427,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -82169,8 +82169,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -89796,8 +89796,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -97746,8 +97746,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -105809,8 +105809,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -114015,8 +114015,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; diff --git a/mysql-test/suite/parts/r/partition_alter2_myisam.result b/mysql-test/suite/parts/r/partition_alter2_myisam.result index 99cb22b97c3..df243a115cc 100644 --- a/mysql-test/suite/parts/r/partition_alter2_myisam.result +++ b/mysql-test/suite/parts/r/partition_alter2_myisam.result @@ -3391,8 +3391,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -7571,8 +7571,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -11802,8 +11802,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -15674,8 +15674,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -23667,8 +23667,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -32127,8 +32127,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -40242,8 +40242,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -44434,8 +44434,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -48677,8 +48677,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -52575,8 +52575,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -60626,8 +60626,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; @@ -69144,8 +69144,8 @@ f_charbig VARCHAR(1000) PARTITION BY LIST(ABS(MOD(f_int1,2))) SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3 (PARTITION part1 VALUES IN (0), - PARTITION part2 VALUES IN (1), - PARTITION part3 VALUES IN (NULL)); +PARTITION part2 VALUES IN (1), +PARTITION part3 VALUES IN (NULL)); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template WHERE f_int1 BETWEEN 1 AND @max_row_div2 - 1; diff --git a/mysql-test/suite/parts/r/partition_engine_ndb.result b/mysql-test/suite/parts/r/partition_engine_ndb.result index a2bed0d6204..2f184248c18 100644 --- a/mysql-test/suite/parts/r/partition_engine_ndb.result +++ b/mysql-test/suite/parts/r/partition_engine_ndb.result @@ -1,15 +1,6 @@ SET @max_row = 20; SET @@session.storage_engine = 'ndbcluster'; -#------------------------------------------------------------------------ -# There are several testcases disabled because of the open bugs -# #15890 -# #18730, Bug#18735 -# The expected results suffer from the following bugs -# harmless #17455, #19305 -# which cannot be suppressed because of technical reasons. -#------------------------------------------------------------------------ - #------------------------------------------------------------------------ # 0. Setting of auxiliary variables + Creation of an auxiliary tables # needed in many testcases @@ -32,7 +23,7 @@ DROP TABLE IF EXISTS t0_definition; CREATE TABLE t0_definition ( state CHAR(3), create_command VARBINARY(5000), -file_list VARBINARY(5000), +file_list VARBINARY(10000), PRIMARY KEY (state) ) ENGINE = MEMORY; DROP TABLE IF EXISTS t0_aux; @@ -66,7 +57,7 @@ f_charbig VARCHAR(1000) PARTITION BY HASH(f_int1) PARTITIONS 2; INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -76,7 +67,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f_int1) PARTITIONS 2 +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -501,7 +492,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 2 Assignment of storage engine just after partition or subpartition @@ -520,7 +511,7 @@ PARTITION part2 STORAGE ENGINE = 'ndbcluster' ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -530,7 +521,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = ndbcluster, PARTITION part2 ENGINE = ndbcluster) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = ndbcluster, PARTITION part2 ENGINE = ndbcluster) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -955,7 +946,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -975,7 +966,7 @@ SUBPARTITION subpart22 STORAGE ENGINE = 'ndbcluster') ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -985,7 +976,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -1408,7 +1399,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 3 Some but not all named partitions or subpartitions get a storage @@ -1425,445 +1416,7 @@ PARTITION BY HASH(f_int1) ( PARTITION part1 STORAGE ENGINE = 'ndbcluster', PARTITION part2 ); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) -create_command -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT NULL, - `f_int2` int(11) DEFAULT NULL, - `f_char1` char(20) DEFAULT NULL, - `f_char2` char(20) DEFAULT NULL, - `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = ndbcluster, PARTITION part2 ENGINE = ndbcluster) - -# check prerequisites-1 success: 1 -# check COUNT(*) success: 1 -# check MIN/MAX(f_int1) success: 1 -# check MIN/MAX(f_int2) success: 1 -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), -CAST(f_int1 AS CHAR), 'delete me' FROM t0_template -WHERE f_int1 IN (2,3); -# check prerequisites-3 success: 1 -DELETE FROM t1 WHERE f_charbig = 'delete me'; -# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE -# check read via f_int1 success: 1 -# check read via f_int2 success: 1 - -# check multiple-1 success: 1 -DELETE FROM t1 WHERE MOD(f_int1,3) = 0; - -# check multiple-2 success: 1 -INSERT INTO t1 SELECT * FROM t0_template -WHERE MOD(f_int1,3) = 0; - -# check multiple-3 success: 1 -UPDATE t1 SET f_int1 = f_int1 + @max_row -WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 -AND @max_row_div2 + @max_row_div4; - -# check multiple-4 success: 1 -DELETE FROM t1 -WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row -AND @max_row_div2 + @max_row_div4 + @max_row; - -# check multiple-5 success: 1 -SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; -INSERT INTO t1 -SET f_int1 = @cur_value , f_int2 = @cur_value, -f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), -f_charbig = '#SINGLE#'; - -# check single-1 success: 1 -SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; -INSERT INTO t1 -SET f_int1 = @cur_value , f_int2 = @cur_value, -f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), -f_charbig = '#SINGLE#'; - -# check single-2 success: 1 -SELECT MIN(f_int1) INTO @cur_value1 FROM t1; -SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; -UPDATE t1 SET f_int1 = @cur_value2 -WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; - -# check single-3 success: 1 -SET @cur_value1= -1; -SELECT MAX(f_int1) INTO @cur_value2 FROM t1; -UPDATE t1 SET f_int1 = @cur_value1 -WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; - -# check single-4 success: 1 -SELECT MAX(f_int1) INTO @cur_value FROM t1; -DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; - -# check single-5 success: 1 -DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; - -# check single-6 success: 1 -INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; - -# check single-7 success: 1 -DELETE FROM t1 WHERE f_charbig = '#2147483647##'; -DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; -INSERT t1 SET f_int1 = 0 , f_int2 = 0, -f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), -f_charbig = '#NULL#'; -INSERT INTO t1 -SET f_int1 = NULL , f_int2 = -@max_row, -f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), -f_charbig = '#NULL#'; -# check null success: 1 - -# check null-1 success: 1 -UPDATE t1 SET f_int1 = -@max_row -WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) -AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; - -# check null-2 success: 1 -UPDATE t1 SET f_int1 = NULL -WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) -AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; - -# check null-3 success: 1 -DELETE FROM t1 -WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) -AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; - -# check null-4 success: 1 -DELETE FROM t1 -WHERE f_int1 = 0 AND f_int2 = 0 -AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) -AND f_charbig = '#NULL#'; -SET AUTOCOMMIT= 0; -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT f_int1, f_int1, '', '', 'was inserted' -FROM t0_template source_tab -WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; - -# check transactions-1 success: 1 -COMMIT WORK; - -# check transactions-2 success: 1 -ROLLBACK WORK; - -# check transactions-3 success: 1 -DELETE FROM t1 WHERE f_charbig = 'was inserted'; -COMMIT WORK; -ROLLBACK WORK; - -# check transactions-4 success: 1 -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT f_int1, f_int1, '', '', 'was inserted' -FROM t0_template source_tab -WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; - -# check transactions-5 success: 1 -ROLLBACK WORK; - -# check transactions-6 success: 1 -# INFO: Storage engine used for t1 seems to be transactional. -COMMIT; - -# check transactions-7 success: 1 -DELETE FROM t1 WHERE f_charbig = 'was inserted'; -COMMIT WORK; -SET @@session.sql_mode = 'traditional'; -SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, -'', '', 'was inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; -ERROR 22012: Division by 0 -COMMIT; - -# check transactions-8 success: 1 -# INFO: Storage engine used for t1 seems to be unable to revert -# changes made by the failing statement. -SET @@session.sql_mode = ''; -SET AUTOCOMMIT= 1; -DELETE FROM t1 WHERE f_charbig = 'was inserted'; -COMMIT WORK; -UPDATE t1 SET f_charbig = REPEAT('b', 1000); - -# check special-1 success: 1 -UPDATE t1 SET f_charbig = ''; - -# check special-2 success: 1 -UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = new.f_int1; -END| -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; - -# check trigger-1 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = new.f_int1; -END| -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; - -# check trigger-2 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = new.f_int1; -END| -UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-3 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = - old.f_int1; -END| -UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-4 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = new.f_int1; -END| -UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-5 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = - old.f_int1; -END| -UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-6 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = - old.f_int1; -END| -DELETE FROM t0_aux -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-7 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = - old.f_int1; -END| -DELETE FROM t0_aux -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-8 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -DELETE FROM t1 -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW -BEGIN -SET new.f_int1 = old.f_int1 + @max_row, -new.f_int2 = old.f_int2 - @max_row, -new.f_charbig = '####updated per update trigger####'; -END| -UPDATE t1 -SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, -f_charbig = '####updated per update statement itself####'; - -# check trigger-9 success: 1 -DROP TRIGGER trg_2; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = CONCAT('===',f_char1,'==='); -CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW -BEGIN -SET new.f_int1 = new.f_int1 + @max_row, -new.f_int2 = new.f_int2 - @max_row, -new.f_charbig = '####updated per update trigger####'; -END| -UPDATE t1 -SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, -f_charbig = '####updated per update statement itself####'; - -# check trigger-10 success: 1 -DROP TRIGGER trg_2; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = CONCAT('===',f_char1,'==='); -CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW -BEGIN -SET new.f_int1 = @my_max1 + @counter, -new.f_int2 = @my_min2 - @counter, -new.f_charbig = '####updated per insert trigger####'; -SET @counter = @counter + 1; -END| -SET @counter = 1; -SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), -CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 -ORDER BY f_int1; -DROP TRIGGER trg_3; - -# check trigger-11 success: 1 -DELETE FROM t1 -WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) -AND f_int2 <> CAST(f_char1 AS SIGNED INT) -AND f_charbig = '####updated per insert trigger####'; -CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW -BEGIN -SET new.f_int1 = @my_max1 + @counter, -new.f_int2 = @my_min2 - @counter, -new.f_charbig = '####updated per insert trigger####'; -SET @counter = @counter + 1; -END| -SET @counter = 1; -SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; -INSERT INTO t1 (f_char1, f_char2, f_charbig) -SELECT CAST(f_int1 AS CHAR), -CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 -ORDER BY f_int1; -DROP TRIGGER trg_3; - -# check trigger-12 success: 1 -DELETE FROM t1 -WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) -AND f_int2 <> CAST(f_char1 AS SIGNED INT) -AND f_charbig = '####updated per insert trigger####'; -ANALYZE TABLE t1; -Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze -CHECK TABLE t1 EXTENDED; -Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check -CHECKSUM TABLE t1 EXTENDED; -Table Checksum -test.t1 -OPTIMIZE TABLE t1; -Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize -# check layout success: 1 -REPAIR TABLE t1 EXTENDED; -Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair -# check layout success: 1 -TRUNCATE t1; - -# check TRUNCATE success: 1 -# check layout success: 1 -# End usability test (include/partition_check.inc) -DROP TABLE t1; +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, @@ -1875,445 +1428,7 @@ PARTITION BY HASH(f_int1) ( PARTITION part1 , PARTITION part2 STORAGE ENGINE = 'ndbcluster' ); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) -create_command -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT NULL, - `f_int2` int(11) DEFAULT NULL, - `f_char1` char(20) DEFAULT NULL, - `f_char2` char(20) DEFAULT NULL, - `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = ndbcluster, PARTITION part2 ENGINE = ndbcluster) - -# check prerequisites-1 success: 1 -# check COUNT(*) success: 1 -# check MIN/MAX(f_int1) success: 1 -# check MIN/MAX(f_int2) success: 1 -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), -CAST(f_int1 AS CHAR), 'delete me' FROM t0_template -WHERE f_int1 IN (2,3); -# check prerequisites-3 success: 1 -DELETE FROM t1 WHERE f_charbig = 'delete me'; -# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE -# check read via f_int1 success: 1 -# check read via f_int2 success: 1 - -# check multiple-1 success: 1 -DELETE FROM t1 WHERE MOD(f_int1,3) = 0; - -# check multiple-2 success: 1 -INSERT INTO t1 SELECT * FROM t0_template -WHERE MOD(f_int1,3) = 0; - -# check multiple-3 success: 1 -UPDATE t1 SET f_int1 = f_int1 + @max_row -WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 -AND @max_row_div2 + @max_row_div4; - -# check multiple-4 success: 1 -DELETE FROM t1 -WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row -AND @max_row_div2 + @max_row_div4 + @max_row; - -# check multiple-5 success: 1 -SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; -INSERT INTO t1 -SET f_int1 = @cur_value , f_int2 = @cur_value, -f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), -f_charbig = '#SINGLE#'; - -# check single-1 success: 1 -SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; -INSERT INTO t1 -SET f_int1 = @cur_value , f_int2 = @cur_value, -f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), -f_charbig = '#SINGLE#'; - -# check single-2 success: 1 -SELECT MIN(f_int1) INTO @cur_value1 FROM t1; -SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; -UPDATE t1 SET f_int1 = @cur_value2 -WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; - -# check single-3 success: 1 -SET @cur_value1= -1; -SELECT MAX(f_int1) INTO @cur_value2 FROM t1; -UPDATE t1 SET f_int1 = @cur_value1 -WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; - -# check single-4 success: 1 -SELECT MAX(f_int1) INTO @cur_value FROM t1; -DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; - -# check single-5 success: 1 -DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; - -# check single-6 success: 1 -INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; - -# check single-7 success: 1 -DELETE FROM t1 WHERE f_charbig = '#2147483647##'; -DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; -INSERT t1 SET f_int1 = 0 , f_int2 = 0, -f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), -f_charbig = '#NULL#'; -INSERT INTO t1 -SET f_int1 = NULL , f_int2 = -@max_row, -f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), -f_charbig = '#NULL#'; -# check null success: 1 - -# check null-1 success: 1 -UPDATE t1 SET f_int1 = -@max_row -WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) -AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; - -# check null-2 success: 1 -UPDATE t1 SET f_int1 = NULL -WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) -AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; - -# check null-3 success: 1 -DELETE FROM t1 -WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) -AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; - -# check null-4 success: 1 -DELETE FROM t1 -WHERE f_int1 = 0 AND f_int2 = 0 -AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) -AND f_charbig = '#NULL#'; -SET AUTOCOMMIT= 0; -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT f_int1, f_int1, '', '', 'was inserted' -FROM t0_template source_tab -WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; - -# check transactions-1 success: 1 -COMMIT WORK; - -# check transactions-2 success: 1 -ROLLBACK WORK; - -# check transactions-3 success: 1 -DELETE FROM t1 WHERE f_charbig = 'was inserted'; -COMMIT WORK; -ROLLBACK WORK; - -# check transactions-4 success: 1 -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT f_int1, f_int1, '', '', 'was inserted' -FROM t0_template source_tab -WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; - -# check transactions-5 success: 1 -ROLLBACK WORK; - -# check transactions-6 success: 1 -# INFO: Storage engine used for t1 seems to be transactional. -COMMIT; - -# check transactions-7 success: 1 -DELETE FROM t1 WHERE f_charbig = 'was inserted'; -COMMIT WORK; -SET @@session.sql_mode = 'traditional'; -SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, -'', '', 'was inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; -ERROR 22012: Division by 0 -COMMIT; - -# check transactions-8 success: 1 -# INFO: Storage engine used for t1 seems to be unable to revert -# changes made by the failing statement. -SET @@session.sql_mode = ''; -SET AUTOCOMMIT= 1; -DELETE FROM t1 WHERE f_charbig = 'was inserted'; -COMMIT WORK; -UPDATE t1 SET f_charbig = REPEAT('b', 1000); - -# check special-1 success: 1 -UPDATE t1 SET f_charbig = ''; - -# check special-2 success: 1 -UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = new.f_int1; -END| -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; - -# check trigger-1 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = new.f_int1; -END| -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; - -# check trigger-2 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = new.f_int1; -END| -UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-3 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = - old.f_int1; -END| -UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-4 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = new.f_int1; -END| -UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-5 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = - old.f_int1; -END| -UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-6 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = - old.f_int1; -END| -DELETE FROM t0_aux -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-7 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = - old.f_int1; -END| -DELETE FROM t0_aux -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-8 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -DELETE FROM t1 -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW -BEGIN -SET new.f_int1 = old.f_int1 + @max_row, -new.f_int2 = old.f_int2 - @max_row, -new.f_charbig = '####updated per update trigger####'; -END| -UPDATE t1 -SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, -f_charbig = '####updated per update statement itself####'; - -# check trigger-9 success: 1 -DROP TRIGGER trg_2; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = CONCAT('===',f_char1,'==='); -CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW -BEGIN -SET new.f_int1 = new.f_int1 + @max_row, -new.f_int2 = new.f_int2 - @max_row, -new.f_charbig = '####updated per update trigger####'; -END| -UPDATE t1 -SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, -f_charbig = '####updated per update statement itself####'; - -# check trigger-10 success: 1 -DROP TRIGGER trg_2; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = CONCAT('===',f_char1,'==='); -CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW -BEGIN -SET new.f_int1 = @my_max1 + @counter, -new.f_int2 = @my_min2 - @counter, -new.f_charbig = '####updated per insert trigger####'; -SET @counter = @counter + 1; -END| -SET @counter = 1; -SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), -CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 -ORDER BY f_int1; -DROP TRIGGER trg_3; - -# check trigger-11 success: 1 -DELETE FROM t1 -WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) -AND f_int2 <> CAST(f_char1 AS SIGNED INT) -AND f_charbig = '####updated per insert trigger####'; -CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW -BEGIN -SET new.f_int1 = @my_max1 + @counter, -new.f_int2 = @my_min2 - @counter, -new.f_charbig = '####updated per insert trigger####'; -SET @counter = @counter + 1; -END| -SET @counter = 1; -SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; -INSERT INTO t1 (f_char1, f_char2, f_charbig) -SELECT CAST(f_int1 AS CHAR), -CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 -ORDER BY f_int1; -DROP TRIGGER trg_3; - -# check trigger-12 success: 1 -DELETE FROM t1 -WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) -AND f_int2 <> CAST(f_char1 AS SIGNED INT) -AND f_charbig = '####updated per insert trigger####'; -ANALYZE TABLE t1; -Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze -CHECK TABLE t1 EXTENDED; -Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check -CHECKSUM TABLE t1 EXTENDED; -Table Checksum -test.t1 -OPTIMIZE TABLE t1; -Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize -# check layout success: 1 -REPAIR TABLE t1 EXTENDED; -Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair -# check layout success: 1 -TRUNCATE t1; - -# check TRUNCATE success: 1 -# check layout success: 1 -# End usability test (include/partition_check.inc) -DROP TABLE t1; +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, @@ -2330,443 +1445,7 @@ PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 STORAGE ENGINE = 'ndbcluster', SUBPARTITION subpart22 STORAGE ENGINE = 'ndbcluster') ); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) -create_command -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `f_int1` int(11) DEFAULT NULL, - `f_int2` int(11) DEFAULT NULL, - `f_char1` char(20) DEFAULT NULL, - `f_char2` char(20) DEFAULT NULL, - `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) - -# check prerequisites-1 success: 1 -# check COUNT(*) success: 1 -# check MIN/MAX(f_int1) success: 1 -# check MIN/MAX(f_int2) success: 1 -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), -CAST(f_int1 AS CHAR), 'delete me' FROM t0_template -WHERE f_int1 IN (2,3); -# check prerequisites-3 success: 1 -DELETE FROM t1 WHERE f_charbig = 'delete me'; -# INFO: Neither f_int1 nor f_int2 nor (f_int1,f_int2) is UNIQUE -# check read via f_int1 success: 1 -# check read via f_int2 success: 1 - -# check multiple-1 success: 1 -DELETE FROM t1 WHERE MOD(f_int1,3) = 0; - -# check multiple-2 success: 1 -INSERT INTO t1 SELECT * FROM t0_template -WHERE MOD(f_int1,3) = 0; - -# check multiple-3 success: 1 -UPDATE t1 SET f_int1 = f_int1 + @max_row -WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 -AND @max_row_div2 + @max_row_div4; - -# check multiple-4 success: 1 -DELETE FROM t1 -WHERE f_int1 BETWEEN @max_row_div2 - @max_row_div4 + @max_row -AND @max_row_div2 + @max_row_div4 + @max_row; - -# check multiple-5 success: 1 -SELECT MIN(f_int1) - 1 INTO @cur_value FROM t1; -INSERT INTO t1 -SET f_int1 = @cur_value , f_int2 = @cur_value, -f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), -f_charbig = '#SINGLE#'; - -# check single-1 success: 1 -SELECT MAX(f_int1) + 1 INTO @cur_value FROM t1; -INSERT INTO t1 -SET f_int1 = @cur_value , f_int2 = @cur_value, -f_char1 = CAST(@cur_value AS CHAR), f_char2 = CAST(@cur_value AS CHAR), -f_charbig = '#SINGLE#'; - -# check single-2 success: 1 -SELECT MIN(f_int1) INTO @cur_value1 FROM t1; -SELECT MAX(f_int1) + 1 INTO @cur_value2 FROM t1; -UPDATE t1 SET f_int1 = @cur_value2 -WHERE f_int1 = @cur_value1 AND f_charbig = '#SINGLE#'; - -# check single-3 success: 1 -SET @cur_value1= -1; -SELECT MAX(f_int1) INTO @cur_value2 FROM t1; -UPDATE t1 SET f_int1 = @cur_value1 -WHERE f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'; - -# check single-4 success: 1 -SELECT MAX(f_int1) INTO @cur_value FROM t1; -DELETE FROM t1 WHERE f_int1 = @cur_value AND f_charbig = '#SINGLE#'; - -# check single-5 success: 1 -DELETE FROM t1 WHERE f_int1 = -1 AND f_charbig = '#SINGLE#'; - -# check single-6 success: 1 -INSERT INTO t1 SET f_int1 = @max_int_4 , f_int2 = @max_int_4, f_charbig = '#2147483647##'; -ERROR HY000: Table has no partition for value 2147483647 -DELETE FROM t1 WHERE f_int1 IS NULL OR f_int1 = 0; -INSERT t1 SET f_int1 = 0 , f_int2 = 0, -f_char1 = CAST(0 AS CHAR), f_char2 = CAST(0 AS CHAR), -f_charbig = '#NULL#'; -INSERT INTO t1 -SET f_int1 = NULL , f_int2 = -@max_row, -f_char1 = CAST(-@max_row AS CHAR), f_char2 = CAST(-@max_row AS CHAR), -f_charbig = '#NULL#'; -# check null success: 1 - -# check null-1 success: 1 -UPDATE t1 SET f_int1 = -@max_row -WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) -AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; - -# check null-2 success: 1 -UPDATE t1 SET f_int1 = NULL -WHERE f_int1 = -@max_row AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) -AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; - -# check null-3 success: 1 -DELETE FROM t1 -WHERE f_int1 IS NULL AND f_int2 = -@max_row AND f_char1 = CAST(-@max_row AS CHAR) -AND f_char2 = CAST(-@max_row AS CHAR) AND f_charbig = '#NULL#'; - -# check null-4 success: 1 -DELETE FROM t1 -WHERE f_int1 = 0 AND f_int2 = 0 -AND f_char1 = CAST(0 AS CHAR) AND f_char2 = CAST(0 AS CHAR) -AND f_charbig = '#NULL#'; -SET AUTOCOMMIT= 0; -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT f_int1, f_int1, '', '', 'was inserted' -FROM t0_template source_tab -WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; - -# check transactions-1 success: 1 -COMMIT WORK; - -# check transactions-2 success: 1 -ROLLBACK WORK; - -# check transactions-3 success: 1 -DELETE FROM t1 WHERE f_charbig = 'was inserted'; -COMMIT WORK; -ROLLBACK WORK; - -# check transactions-4 success: 1 -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT f_int1, f_int1, '', '', 'was inserted' -FROM t0_template source_tab -WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; - -# check transactions-5 success: 1 -ROLLBACK WORK; - -# check transactions-6 success: 1 -# INFO: Storage engine used for t1 seems to be transactional. -COMMIT; - -# check transactions-7 success: 1 -DELETE FROM t1 WHERE f_charbig = 'was inserted'; -COMMIT WORK; -SET @@session.sql_mode = 'traditional'; -SELECT @max_row_div2 + @max_row_div4 - @max_row_div4 + 1 INTO @exp_inserted_rows; -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT IF(f_int1 = @max_row_div2,f_int1 / 0,f_int1),f_int1, -'', '', 'was inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div4 AND @max_row_div2 + @max_row_div4; -ERROR 22012: Division by 0 -COMMIT; - -# check transactions-8 success: 1 -# INFO: Storage engine used for t1 seems to be unable to revert -# changes made by the failing statement. -SET @@session.sql_mode = ''; -SET AUTOCOMMIT= 1; -DELETE FROM t1 WHERE f_charbig = 'was inserted'; -COMMIT WORK; -UPDATE t1 SET f_charbig = REPEAT('b', 1000); - -# check special-1 success: 1 -UPDATE t1 SET f_charbig = ''; - -# check special-2 success: 1 -UPDATE t1 SET f_charbig = CONCAT('===',CAST(f_int1 AS CHAR),'==='); -INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 BEFORE INSERT ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = new.f_int1; -END| -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; - -# check trigger-1 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 AFTER INSERT ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = new.f_int1; -END| -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT f_int1,f_int2,f_char1,f_char2,NULL FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; - -# check trigger-2 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = new.f_int1; -END| -UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-3 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 BEFORE UPDATE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = - old.f_int1; -END| -UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-4 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = new.f_int1; -END| -UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-5 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 AFTER UPDATE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = - old.f_int1; -END| -UPDATE t0_aux SET f_int1 = - f_int1, f_int2 = - f_int2 -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-6 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 BEFORE DELETE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = - old.f_int1; -END| -DELETE FROM t0_aux -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-7 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -INSERT INTO t0_aux(f_int1,f_int2,f_char1,f_char2,f_charbig) -SELECT -f_int1,-f_int1,CAST(-f_int1 AS CHAR),CAST(-f_int1 AS CHAR), -'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_1 AFTER DELETE ON t0_aux FOR EACH ROW -BEGIN -UPDATE t1 SET f_int1 = -f_int1, f_int2 = -f_int2, -f_charbig = 'updated by trigger' - WHERE f_int1 = - old.f_int1; -END| -DELETE FROM t0_aux -WHERE f_int1 IN (- (@max_row_div2 - 1),- @max_row_div2,- (@max_row_div2 + 1)); - -# check trigger-8 success: 1 -DROP TRIGGER trg_1; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = 'just inserted' - WHERE f_int1 <> CAST(f_char1 AS SIGNED INT); -DELETE FROM t0_aux -WHERE ABS(f_int1) BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -DELETE FROM t1 -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1; -CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW -BEGIN -SET new.f_int1 = old.f_int1 + @max_row, -new.f_int2 = old.f_int2 - @max_row, -new.f_charbig = '####updated per update trigger####'; -END| -UPDATE t1 -SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, -f_charbig = '####updated per update statement itself####'; - -# check trigger-9 success: 1 -DROP TRIGGER trg_2; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = CONCAT('===',f_char1,'==='); -CREATE TRIGGER trg_2 BEFORE UPDATE ON t1 FOR EACH ROW -BEGIN -SET new.f_int1 = new.f_int1 + @max_row, -new.f_int2 = new.f_int2 - @max_row, -new.f_charbig = '####updated per update trigger####'; -END| -UPDATE t1 -SET f_int1 = f_int1 + @max_row, f_int2 = f_int2 - @max_row, -f_charbig = '####updated per update statement itself####'; - -# check trigger-10 success: 1 -DROP TRIGGER trg_2; -UPDATE t1 SET f_int1 = CAST(f_char1 AS SIGNED INT), -f_int2 = CAST(f_char1 AS SIGNED INT), -f_charbig = CONCAT('===',f_char1,'==='); -CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW -BEGIN -SET new.f_int1 = @my_max1 + @counter, -new.f_int2 = @my_min2 - @counter, -new.f_charbig = '####updated per insert trigger####'; -SET @counter = @counter + 1; -END| -SET @counter = 1; -SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; -INSERT INTO t1 (f_int1, f_int2, f_char1, f_char2, f_charbig) -SELECT f_int1, f_int1, CAST(f_int1 AS CHAR), -CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 -ORDER BY f_int1; -DROP TRIGGER trg_3; - -# check trigger-11 success: 1 -DELETE FROM t1 -WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) -AND f_int2 <> CAST(f_char1 AS SIGNED INT) -AND f_charbig = '####updated per insert trigger####'; -CREATE TRIGGER trg_3 BEFORE INSERT ON t1 FOR EACH ROW -BEGIN -SET new.f_int1 = @my_max1 + @counter, -new.f_int2 = @my_min2 - @counter, -new.f_charbig = '####updated per insert trigger####'; -SET @counter = @counter + 1; -END| -SET @counter = 1; -SELECT MAX(f_int1), MIN(f_int2) INTO @my_max1,@my_min2 FROM t1; -INSERT INTO t1 (f_char1, f_char2, f_charbig) -SELECT CAST(f_int1 AS CHAR), -CAST(f_int1 AS CHAR), 'just inserted' FROM t0_template -WHERE f_int1 BETWEEN @max_row_div2 - 1 AND @max_row_div2 + 1 -ORDER BY f_int1; -DROP TRIGGER trg_3; - -# check trigger-12 success: 1 -DELETE FROM t1 -WHERE f_int1 <> CAST(f_char1 AS SIGNED INT) -AND f_int2 <> CAST(f_char1 AS SIGNED INT) -AND f_charbig = '####updated per insert trigger####'; -ANALYZE TABLE t1; -Table Op Msg_type Msg_text -test.t1 analyze note The storage engine for the table doesn't support analyze -CHECK TABLE t1 EXTENDED; -Table Op Msg_type Msg_text -test.t1 check note The storage engine for the table doesn't support check -CHECKSUM TABLE t1 EXTENDED; -Table Checksum -test.t1 -OPTIMIZE TABLE t1; -Table Op Msg_type Msg_text -test.t1 optimize note The storage engine for the table doesn't support optimize -# check layout success: 1 -REPAIR TABLE t1 EXTENDED; -Table Op Msg_type Msg_text -test.t1 repair note The storage engine for the table doesn't support repair -# check layout success: 1 -TRUNCATE t1; - -# check TRUNCATE success: 1 -# check layout success: 1 -# End usability test (include/partition_check.inc) -DROP TABLE t1; +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, @@ -2783,9 +1462,27 @@ PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21, SUBPARTITION subpart22 ) ); +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +) +ENGINE = 'ndbcluster' +PARTITION BY RANGE(f_int1) +SUBPARTITION BY HASH(f_int1) +( PARTITION part1 VALUES LESS THAN (10) +(SUBPARTITION subpart11 STORAGE ENGINE = 'ndbcluster', +SUBPARTITION subpart12 STORAGE ENGINE = 'ndbcluster'), +PARTITION part2 VALUES LESS THAN (2147483646) +(SUBPARTITION subpart21, +SUBPARTITION subpart22 ) +); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -2795,7 +1492,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3218,7 +1915,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 4 Storage engine assignment after partition name + after name of @@ -3233,6 +1930,41 @@ f_charbig VARCHAR(1000) ) PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) +( PARTITION part1 VALUES LESS THAN (10) +(SUBPARTITION subpart11, +SUBPARTITION subpart12), +PARTITION part2 VALUES LESS THAN (2147483646) +(SUBPARTITION subpart21 STORAGE ENGINE = 'ndbcluster', +SUBPARTITION subpart22 STORAGE ENGINE = 'ndbcluster') +); +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +) +ENGINE = 'ndbcluster' +PARTITION BY RANGE(f_int1) +SUBPARTITION BY HASH(f_int1) +( PARTITION part1 VALUES LESS THAN (10) ENGINE = 'ndbcluster' +(SUBPARTITION subpart11, +SUBPARTITION subpart12), +PARTITION part2 VALUES LESS THAN (2147483646) +(SUBPARTITION subpart21, +SUBPARTITION subpart22 STORAGE ENGINE = 'ndbcluster') +); +DROP TABLE t1; +CREATE TABLE t1 ( +f_int1 INTEGER, +f_int2 INTEGER, +f_char1 CHAR(20), +f_char2 CHAR(20), +f_charbig VARCHAR(1000) +) +PARTITION BY RANGE(f_int1) +SUBPARTITION BY HASH(f_int1) ( PARTITION part1 VALUES LESS THAN (10) ENGINE = 'ndbcluster' (SUBPARTITION subpart11, SUBPARTITION subpart12), @@ -3242,7 +1974,7 @@ SUBPARTITION subpart22 STORAGE ENGINE = 'ndbcluster') ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -3252,7 +1984,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -3675,7 +2407,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -3690,12 +2422,12 @@ SUBPARTITION BY HASH(f_int1) (SUBPARTITION subpart11 STORAGE ENGINE = 'ndbcluster', SUBPARTITION subpart12 STORAGE ENGINE = 'ndbcluster'), PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = 'ndbcluster' -(SUBPARTITION subpart21, +(SUBPARTITION subpart21 ENGINE = 'ndbcluster', SUBPARTITION subpart22) ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -3705,7 +2437,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4128,7 +2860,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 5 Precedence of storage engine assignments (if there is any) @@ -4148,7 +2880,7 @@ PARTITION part2 STORAGE ENGINE = 'ndbcluster' ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -4158,7 +2890,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = ndbcluster, PARTITION part2 ENGINE = ndbcluster) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = ndbcluster, PARTITION part2 ENGINE = ndbcluster) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -4583,7 +3315,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -4603,7 +3335,7 @@ SUBPARTITION subpart22 STORAGE ENGINE = 'ndbcluster') ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -4613,7 +3345,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5036,10 +3768,11 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; # 6.2 Storage engine assignment after partition name + after # subpartition name +# in partition part + in sub partition part CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, @@ -5058,7 +3791,7 @@ SUBPARTITION subpart22 STORAGE ENGINE = 'ndbcluster') ); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -5068,7 +3801,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = ndbcluster, SUBPARTITION subpart22 ENGINE = ndbcluster)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5491,7 +4224,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; #------------------------------------------------------------------------ # 6 Session default engine differs from engine used within create table @@ -5507,7 +4240,7 @@ f_charbig VARCHAR(1000) PARTITION BY HASH(f_int1) ( PARTITION part1 ENGINE = 'ndbcluster'); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -5517,7 +4250,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = ndbcluster) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = ndbcluster) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -5944,7 +4677,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; CREATE TABLE t1 ( f_int1 INTEGER, @@ -5960,7 +4693,7 @@ SUBPARTITION BY HASH(f_int1) SUBPARTITION subpart12 STORAGE ENGINE = 'ndbcluster')); INSERT INTO t1(f_int1,f_int2,f_char1,f_char2,f_charbig) SELECT f_int1,f_int2,f_char1,f_char2,f_charbig FROM t0_template; -# Start usability test (include/partition_check.inc) +# Start usability test (inc/partition_check.inc) create_command SHOW CREATE TABLE t1; Table Create Table @@ -5970,7 +4703,7 @@ t1 CREATE TABLE `t1` ( `f_char1` char(20) DEFAULT NULL, `f_char2` char(20) DEFAULT NULL, `f_charbig` varchar(1000) DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster)) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = ndbcluster, SUBPARTITION subpart12 ENGINE = ndbcluster)) */ # check prerequisites-1 success: 1 # check COUNT(*) success: 1 @@ -6397,7 +5130,7 @@ TRUNCATE t1; # check TRUNCATE success: 1 # check layout success: 1 -# End usability test (include/partition_check.inc) +# End usability test (inc/partition_check.inc) DROP TABLE t1; SET SESSION storage_engine='ndbcluster'; DROP VIEW IF EXISTS v1; diff --git a/mysql-test/suite/parts/r/partition_int_innodb.result b/mysql-test/suite/parts/r/partition_int_innodb.result index 9f1712e141e..622f79616b0 100644 --- a/mysql-test/suite/parts/r/partition_int_innodb.result +++ b/mysql-test/suite/parts/r/partition_int_innodb.result @@ -14,8 +14,8 @@ insert into t1 values (255), (254), (253), (252), (1), (2), (128); select * from t1; a 1 -2 128 +2 252 253 254 @@ -27,8 +27,8 @@ delete from t1 where a=253; select * from t1; a 1 -2 128 +2 252 254 255 @@ -64,19 +64,19 @@ count(*) 255 drop table t2; create table t3 (a tinyint not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` tinyint(4) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (127), (126), (125), (124), (-128), (-127), (1), (-1), (0); select * from t3; a --128 --127 -1 +-127 +-128 0 1 124 @@ -89,9 +89,9 @@ a delete from t3 where a=125; select * from t3; a --128 --127 -1 +-127 +-128 0 1 124 @@ -164,19 +164,19 @@ count(*) 1024 drop table t2; create table t3 (a smallint not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` smallint(6) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (32767), (32766), (32765), (32764), (-32768), (-32767), (1), (-1), (0); select * from t3; a --32768 --32767 -1 +-32767 +-32768 0 1 32764 @@ -189,9 +189,9 @@ a delete from t3 where a=32765; select * from t3; a --32768 --32767 -1 +-32767 +-32768 0 1 32764 @@ -215,11 +215,11 @@ select * from t1; a 1 2 -65535 4294967292 4294967293 4294967294 4294967295 +65535 select * from t1 where a=4294967293; a 4294967293 @@ -228,19 +228,19 @@ select * from t1; a 1 2 -65535 4294967292 4294967294 4294967295 +65535 drop table t1; create table t2 (a int unsigned not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; +partition by key (a) partitions 8; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` int(10) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */ insert into t2 values (4294967295), (4294967294), (4294967293), (4294967292); select * from t2; a @@ -264,19 +264,19 @@ count(*) 1024 drop table t2; create table t3 (a int not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` int(11) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (2147483647), (2147483646), (2147483645), (2147483644), (-2147483648), (-2147483647), (1), (-1), (0); select * from t3; a --2147483648 --2147483647 -1 +-2147483647 +-2147483648 0 1 2147483644 @@ -289,9 +289,9 @@ a delete from t3 where a=2147483645; select * from t3; a --2147483648 --2147483647 -1 +-2147483647 +-2147483648 0 1 2147483644 @@ -314,12 +314,12 @@ insert into t1 values (16777215), (16777214), (16777213), (16777212), (1), (2), select * from t1; a 1 -2 -65535 16777212 16777213 16777214 16777215 +2 +65535 select * from t1 where a=16777213; a 16777213 @@ -327,11 +327,11 @@ delete from t1 where a=16777213; select * from t1; a 1 -2 -65535 16777212 16777214 16777215 +2 +65535 drop table t1; create table t2 (a mediumint unsigned not null, primary key(a)) engine='InnoDB' partition by key (a) partitions 8; @@ -364,19 +364,19 @@ count(*) 1024 drop table t2; create table t3 (a mediumint not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` mediumint(9) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (8388607), (8388606), (8388605), (8388604), (-8388608), (-8388607), (1), (-1), (0); select * from t3; a --8388608 --8388607 -1 +-8388607 +-8388608 0 1 8388604 @@ -389,9 +389,9 @@ a delete from t3 where a=8388605; select * from t3; a --8388608 --8388607 -1 +-8388607 +-8388608 0 1 8388604 @@ -414,24 +414,24 @@ insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073 select * from t1; a 1 -2 -65535 18446744073709551612 18446744073709551613 18446744073709551614 18446744073709551615 +2 +65535 select * from t1 where a=-2; a delete from t1 where a=-2; select * from t1; a 1 -2 -65535 18446744073709551612 18446744073709551613 18446744073709551614 18446744073709551615 +2 +65535 select * from t1 where a=18446744073709551615; a 18446744073709551615 @@ -439,20 +439,20 @@ delete from t1 where a=18446744073709551615; select * from t1; a 1 -2 -65535 18446744073709551612 18446744073709551613 18446744073709551614 +2 +65535 drop table t1; create table t2 (a bigint unsigned not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; +partition by key (a) partitions 8; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` bigint(20) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */ insert into t2 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612); select * from t2; a @@ -476,19 +476,19 @@ count(*) 1024 drop table t2; create table t3 (a bigint not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` bigint(20) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (9223372036854775807), (9223372036854775806), (9223372036854775805), (9223372036854775804), (-9223372036854775808), (-9223372036854775807), (1), (-1), (0); select * from t3; a --9223372036854775808 --9223372036854775807 -1 +-9223372036854775807 +-9223372036854775808 0 1 9223372036854775804 @@ -501,9 +501,9 @@ a delete from t3 where a=9223372036854775806; select * from t3; a --9223372036854775808 --9223372036854775807 -1 +-9223372036854775807 +-9223372036854775808 0 1 9223372036854775804 diff --git a/mysql-test/suite/parts/r/partition_int_myisam.result b/mysql-test/suite/parts/r/partition_int_myisam.result index 1e0ba724f4c..b9380dcda74 100644 --- a/mysql-test/suite/parts/r/partition_int_myisam.result +++ b/mysql-test/suite/parts/r/partition_int_myisam.result @@ -14,8 +14,8 @@ insert into t1 values (255), (254), (253), (252), (1), (2), (128); select * from t1; a 1 -2 128 +2 252 253 254 @@ -27,8 +27,8 @@ delete from t1 where a=253; select * from t1; a 1 -2 128 +2 252 254 255 @@ -64,19 +64,19 @@ count(*) 255 drop table t2; create table t3 (a tinyint not null, primary key(a)) engine='MYISAM' -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` tinyint(4) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (127), (126), (125), (124), (-128), (-127), (1), (-1), (0); select * from t3; a --128 --127 -1 +-127 +-128 0 1 124 @@ -89,9 +89,9 @@ a delete from t3 where a=125; select * from t3; a --128 --127 -1 +-127 +-128 0 1 124 @@ -164,19 +164,19 @@ count(*) 65535 drop table t2; create table t3 (a smallint not null, primary key(a)) engine='MYISAM' -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` smallint(6) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (32767), (32766), (32765), (32764), (-32768), (-32767), (1), (-1), (0); select * from t3; a --32768 --32767 -1 +-32767 +-32768 0 1 32764 @@ -189,9 +189,9 @@ a delete from t3 where a=32765; select * from t3; a --32768 --32767 -1 +-32767 +-32768 0 1 32764 @@ -215,11 +215,11 @@ select * from t1; a 1 2 -65535 4294967292 4294967293 4294967294 4294967295 +65535 select * from t1 where a=4294967293; a 4294967293 @@ -228,19 +228,19 @@ select * from t1; a 1 2 -65535 4294967292 4294967294 4294967295 +65535 drop table t1; create table t2 (a int unsigned not null, primary key(a)) engine='MYISAM' -partition by key (a) partitions 10; +partition by key (a) partitions 8; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` int(10) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */ insert into t2 values (4294967295), (4294967294), (4294967293), (4294967292); select * from t2; a @@ -264,19 +264,19 @@ count(*) 65535 drop table t2; create table t3 (a int not null, primary key(a)) engine='MYISAM' -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` int(11) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (2147483647), (2147483646), (2147483645), (2147483644), (-2147483648), (-2147483647), (1), (-1), (0); select * from t3; a --2147483648 --2147483647 -1 +-2147483647 +-2147483648 0 1 2147483644 @@ -289,9 +289,9 @@ a delete from t3 where a=2147483645; select * from t3; a --2147483648 --2147483647 -1 +-2147483647 +-2147483648 0 1 2147483644 @@ -314,12 +314,12 @@ insert into t1 values (16777215), (16777214), (16777213), (16777212), (1), (2), select * from t1; a 1 -2 -65535 16777212 16777213 16777214 16777215 +2 +65535 select * from t1 where a=16777213; a 16777213 @@ -327,11 +327,11 @@ delete from t1 where a=16777213; select * from t1; a 1 -2 -65535 16777212 16777214 16777215 +2 +65535 drop table t1; create table t2 (a mediumint unsigned not null, primary key(a)) engine='MYISAM' partition by key (a) partitions 8; @@ -364,19 +364,19 @@ count(*) 65535 drop table t2; create table t3 (a mediumint not null, primary key(a)) engine='MYISAM' -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` mediumint(9) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (8388607), (8388606), (8388605), (8388604), (-8388608), (-8388607), (1), (-1), (0); select * from t3; a --8388608 --8388607 -1 +-8388607 +-8388608 0 1 8388604 @@ -389,9 +389,9 @@ a delete from t3 where a=8388605; select * from t3; a --8388608 --8388607 -1 +-8388607 +-8388608 0 1 8388604 @@ -414,24 +414,24 @@ insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073 select * from t1; a 1 -2 -65535 18446744073709551612 18446744073709551613 18446744073709551614 18446744073709551615 +2 +65535 select * from t1 where a=-2; a delete from t1 where a=-2; select * from t1; a 1 -2 -65535 18446744073709551612 18446744073709551613 18446744073709551614 18446744073709551615 +2 +65535 select * from t1 where a=18446744073709551615; a 18446744073709551615 @@ -439,20 +439,20 @@ delete from t1 where a=18446744073709551615; select * from t1; a 1 -2 -65535 18446744073709551612 18446744073709551613 18446744073709551614 +2 +65535 drop table t1; create table t2 (a bigint unsigned not null, primary key(a)) engine='MYISAM' -partition by key (a) partitions 10; +partition by key (a) partitions 8; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` bigint(20) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */ insert into t2 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612); select * from t2; a @@ -476,19 +476,19 @@ count(*) 65535 drop table t2; create table t3 (a bigint not null, primary key(a)) engine='MYISAM' -partition by key (a) partitions 10; +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` bigint(20) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (9223372036854775807), (9223372036854775806), (9223372036854775805), (9223372036854775804), (-9223372036854775808), (-9223372036854775807), (1), (-1), (0); select * from t3; a --9223372036854775808 --9223372036854775807 -1 +-9223372036854775807 +-9223372036854775808 0 1 9223372036854775804 @@ -501,9 +501,9 @@ a delete from t3 where a=9223372036854775806; select * from t3; a --9223372036854775808 --9223372036854775807 -1 +-9223372036854775807 +-9223372036854775808 0 1 9223372036854775804 diff --git a/mysql-test/suite/parts/r/partition_int_ndb.result b/mysql-test/suite/parts/r/partition_int_ndb.result index 8bc095b2886..e7eb19ca6e5 100644 --- a/mysql-test/suite/parts/r/partition_int_ndb.result +++ b/mysql-test/suite/parts/r/partition_int_ndb.result @@ -1,29 +1,21 @@ -create table t1 (a tinyint unsigned not null, primary key(a)) engine='InnoDB' +create table t1 (a tinyint unsigned not null, primary key(a)) engine='NDB' partition by key (a) ( -partition pa1 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=20 min_rows=2, -partition pa2 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=30 min_rows=3, -partition pa3 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=30 min_rows=4, -partition pa4 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=40 min_rows=2); +partition pa1 max_rows=20 min_rows=2, +partition pa2 max_rows=30 min_rows=3, +partition pa3 max_rows=30 min_rows=4, +partition pa4 max_rows=40 min_rows=2); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` tinyint(3) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = ndbcluster, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = ndbcluster, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = ndbcluster, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = ndbcluster) */ insert into t1 values (255), (254), (253), (252), (1), (2), (128); select * from t1; a 1 -2 128 +2 252 253 254 @@ -35,20 +27,20 @@ delete from t1 where a=253; select * from t1; a 1 -2 128 +2 252 254 255 drop table t1; -create table t2 (a tinyint unsigned not null, primary key(a)) engine='InnoDB' +create table t2 (a tinyint unsigned not null, primary key(a)) engine='NDB' partition by key (a) partitions 8; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` tinyint(3) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */ insert into t2 values (255), (254), (253), (252); select * from t2; a @@ -71,20 +63,20 @@ select count(*) from t2; count(*) 255 drop table t2; -create table t3 (a tinyint not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; +create table t3 (a tinyint not null, primary key(a)) engine='NDB' +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` tinyint(4) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (127), (126), (125), (124), (-128), (-127), (1), (-1), (0); select * from t3; a --128 --127 -1 +-127 +-128 0 1 124 @@ -97,35 +89,27 @@ a delete from t3 where a=125; select * from t3; a --128 --127 -1 +-127 +-128 0 1 124 126 127 drop table t3; -create table t1 (a smallint unsigned not null, primary key(a)) engine='InnoDB' +create table t1 (a smallint unsigned not null, primary key(a)) engine='NDB' partition by key (a) ( -partition pa1 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=20 min_rows=2, -partition pa2 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=30 min_rows=3, -partition pa3 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=30 min_rows=4, -partition pa4 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=40 min_rows=2); +partition pa1 max_rows=20 min_rows=2, +partition pa2 max_rows=30 min_rows=3, +partition pa3 max_rows=30 min_rows=4, +partition pa4 max_rows=40 min_rows=2); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` smallint(5) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = ndbcluster, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = ndbcluster, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = ndbcluster, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = ndbcluster) */ insert into t1 values (65535), (65534), (65533), (65532), (1), (2), (256); select * from t1; a @@ -149,14 +133,14 @@ a 65534 65535 drop table t1; -create table t2 (a smallint unsigned not null, primary key(a)) engine='InnoDB' +create table t2 (a smallint unsigned not null, primary key(a)) engine='NDB' partition by key (a) partitions 8; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` smallint(5) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */ insert into t2 values (65535), (65534), (65533), (65532); select * from t2; a @@ -179,20 +163,20 @@ select count(*) from t2; count(*) 1024 drop table t2; -create table t3 (a smallint not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; +create table t3 (a smallint not null, primary key(a)) engine='NDB' +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` smallint(6) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (32767), (32766), (32765), (32764), (-32768), (-32767), (1), (-1), (0); select * from t3; a --32768 --32767 -1 +-32767 +-32768 0 1 32764 @@ -205,45 +189,37 @@ a delete from t3 where a=32765; select * from t3; a --32768 --32767 -1 +-32767 +-32768 0 1 32764 32766 32767 drop table t3; -create table t1 (a int unsigned not null, primary key(a)) engine='InnoDB' +create table t1 (a int unsigned not null, primary key(a)) engine='NDB' partition by key (a) ( -partition pa1 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=20 min_rows=2, -partition pa2 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=30 min_rows=3, -partition pa3 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=30 min_rows=4, -partition pa4 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=40 min_rows=2); +partition pa1 max_rows=20 min_rows=2, +partition pa2 max_rows=30 min_rows=3, +partition pa3 max_rows=30 min_rows=4, +partition pa4 max_rows=40 min_rows=2); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(10) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = ndbcluster, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = ndbcluster, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = ndbcluster, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = ndbcluster) */ insert into t1 values (4294967295), (4294967294), (4294967293), (4294967292), (1), (2), (65535); select * from t1; a 1 2 -65535 4294967292 4294967293 4294967294 4294967295 +65535 select * from t1 where a=4294967293; a 4294967293 @@ -252,19 +228,19 @@ select * from t1; a 1 2 -65535 4294967292 4294967294 4294967295 +65535 drop table t1; -create table t2 (a int unsigned not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; +create table t2 (a int unsigned not null, primary key(a)) engine='NDB' +partition by key (a) partitions 8; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` int(10) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */ insert into t2 values (4294967295), (4294967294), (4294967293), (4294967292); select * from t2; a @@ -287,20 +263,20 @@ select count(*) from t2; count(*) 1024 drop table t2; -create table t3 (a int not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; +create table t3 (a int not null, primary key(a)) engine='NDB' +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` int(11) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (2147483647), (2147483646), (2147483645), (2147483644), (-2147483648), (-2147483647), (1), (-1), (0); select * from t3; a --2147483648 --2147483647 -1 +-2147483647 +-2147483648 0 1 2147483644 @@ -313,45 +289,37 @@ a delete from t3 where a=2147483645; select * from t3; a --2147483648 --2147483647 -1 +-2147483647 +-2147483648 0 1 2147483644 2147483646 2147483647 drop table t3; -create table t1 (a mediumint unsigned not null, primary key(a)) engine='InnoDB' +create table t1 (a mediumint unsigned not null, primary key(a)) engine='NDB' partition by key (a) ( -partition pa1 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=20 min_rows=2, -partition pa2 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=30 min_rows=3, -partition pa3 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=30 min_rows=4, -partition pa4 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=40 min_rows=2); +partition pa1 max_rows=20 min_rows=2, +partition pa2 max_rows=30 min_rows=3, +partition pa3 max_rows=30 min_rows=4, +partition pa4 max_rows=40 min_rows=2); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` mediumint(8) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = ndbcluster, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = ndbcluster, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = ndbcluster, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = ndbcluster) */ insert into t1 values (16777215), (16777214), (16777213), (16777212), (1), (2), (65535); select * from t1; a 1 -2 -65535 16777212 16777213 16777214 16777215 +2 +65535 select * from t1 where a=16777213; a 16777213 @@ -359,20 +327,20 @@ delete from t1 where a=16777213; select * from t1; a 1 -2 -65535 16777212 16777214 16777215 +2 +65535 drop table t1; -create table t2 (a mediumint unsigned not null, primary key(a)) engine='InnoDB' +create table t2 (a mediumint unsigned not null, primary key(a)) engine='NDB' partition by key (a) partitions 8; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` mediumint(8) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */ insert into t2 values (16777215), (16777214), (16777213), (16777212); select * from t2; a @@ -395,20 +363,20 @@ select count(*) from t2; count(*) 1024 drop table t2; -create table t3 (a mediumint not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; +create table t3 (a mediumint not null, primary key(a)) engine='NDB' +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` mediumint(9) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (8388607), (8388606), (8388605), (8388604), (-8388608), (-8388607), (1), (-1), (0); select * from t3; a --8388608 --8388607 -1 +-8388607 +-8388608 0 1 8388604 @@ -421,57 +389,49 @@ a delete from t3 where a=8388605; select * from t3; a --8388608 --8388607 -1 +-8388607 +-8388608 0 1 8388604 8388606 8388607 drop table t3; -create table t1 (a bigint unsigned not null, primary key(a)) engine='InnoDB' +create table t1 (a bigint unsigned not null, primary key(a)) engine='NDB' partition by key (a) ( -partition pa1 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=20 min_rows=2, -partition pa2 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=30 min_rows=3, -partition pa3 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=30 min_rows=4, -partition pa4 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=40 min_rows=2); +partition pa1 max_rows=20 min_rows=2, +partition pa2 max_rows=30 min_rows=3, +partition pa3 max_rows=30 min_rows=4, +partition pa4 max_rows=40 min_rows=2); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = InnoDB) */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 ENGINE = ndbcluster, PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 ENGINE = ndbcluster, PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 ENGINE = ndbcluster, PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 ENGINE = ndbcluster) */ insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612), (1), (2), (65535); select * from t1; a 1 -2 -65535 18446744073709551612 18446744073709551613 18446744073709551614 18446744073709551615 +2 +65535 select * from t1 where a=-2; a delete from t1 where a=-2; select * from t1; a 1 -2 -65535 18446744073709551612 18446744073709551613 18446744073709551614 18446744073709551615 +2 +65535 select * from t1 where a=18446744073709551615; a 18446744073709551615 @@ -479,20 +439,20 @@ delete from t1 where a=18446744073709551615; select * from t1; a 1 -2 -65535 18446744073709551612 18446744073709551613 18446744073709551614 +2 +65535 drop table t1; -create table t2 (a bigint unsigned not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; +create table t2 (a bigint unsigned not null, primary key(a)) engine='NDB' +partition by key (a) partitions 8; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( `a` bigint(20) unsigned NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 8 */ insert into t2 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612); select * from t2; a @@ -515,20 +475,20 @@ select count(*) from t2; count(*) 1024 drop table t2; -create table t3 (a bigint not null, primary key(a)) engine='InnoDB' -partition by key (a) partitions 10; +create table t3 (a bigint not null, primary key(a)) engine='NDB' +partition by key (a) partitions 7; show create table t3; Table Create Table t3 CREATE TABLE `t3` ( `a` bigint(20) NOT NULL, PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 7 */ insert into t3 values (9223372036854775807), (9223372036854775806), (9223372036854775805), (9223372036854775804), (-9223372036854775808), (-9223372036854775807), (1), (-1), (0); select * from t3; a --9223372036854775808 --9223372036854775807 -1 +-9223372036854775807 +-9223372036854775808 0 1 9223372036854775804 @@ -541,9 +501,9 @@ a delete from t3 where a=9223372036854775806; select * from t3; a --9223372036854775808 --9223372036854775807 -1 +-9223372036854775807 +-9223372036854775808 0 1 9223372036854775804 diff --git a/mysql-test/suite/parts/r/rpl_ndb_dd_partitions.result b/mysql-test/suite/parts/r/rpl_ndb_dd_partitions.result deleted file mode 100644 index ece6b84c227..00000000000 --- a/mysql-test/suite/parts/r/rpl_ndb_dd_partitions.result +++ /dev/null @@ -1,726 +0,0 @@ -stop slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -start slave; ---- Doing pre test cleanup --- -DROP TABLE IF EXISTS t1; -CREATE LOGFILE GROUP lg1 -ADD UNDOFILE 'undofile.dat' -INITIAL_SIZE 16M -UNDO_BUFFER_SIZE = 1M -ENGINE=NDB; -ALTER LOGFILE GROUP lg1 -ADD UNDOFILE 'undofile02.dat' -INITIAL_SIZE = 4M -ENGINE=NDB; -CREATE TABLESPACE ts1 -ADD DATAFILE 'datafile.dat' -USE LOGFILE GROUP lg1 -INITIAL_SIZE 12M -ENGINE NDB; -ALTER TABLESPACE ts1 -ADD DATAFILE 'datafile02.dat' -INITIAL_SIZE = 4M -ENGINE=NDB; ---- Start test 2 partition RANGE testing -- ---- Do setup -- -CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63), -bc CHAR(63), d DECIMAL(10,4) DEFAULT 0, -f FLOAT DEFAULT 0, total BIGINT UNSIGNED, -y YEAR, t DATE) -TABLESPACE ts1 STORAGE DISK -ENGINE=NDB -PARTITION BY RANGE (YEAR(t)) -(PARTITION p0 VALUES LESS THAN (1901), -PARTITION p1 VALUES LESS THAN (1946), -PARTITION p2 VALUES LESS THAN (1966), -PARTITION p3 VALUES LESS THAN (1986), -PARTITION p4 VALUES LESS THAN (2005), -PARTITION p5 VALUES LESS THAN MAXVALUE); ---- Show table on master --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(63) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned DEFAULT NULL, - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL -) TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) ---- Show table on slave -- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(63) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned DEFAULT NULL, - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL -) TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) ---- Perform basic operation on master --- ---- and ensure replicated correctly --- -"--- Insert into t1 --" as ""; ---- Select from t1 on master --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Select from t1 on slave --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Update t1 on master -- -UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; ---- Check the update on master --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Check Update on slave --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Remove a record from t1 on master --- -DELETE FROM t1 WHERE id = 42; ---- Show current count on master for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 ---- Show current count on slave for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 -DELETE FROM t1; ---- Check that simple Alter statements are replicated correctly --- -ALTER TABLE t1 MODIFY vc VARCHAR(255); ---- Show the new improved table on the master --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(255) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned DEFAULT NULL, - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) ---- Make sure that our tables on slave are still same engine --- ---- and that the alter statements replicated correctly --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(255) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned DEFAULT NULL, - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (YEAR(t)) (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster, PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster) ---- Perform basic operation on master --- ---- and ensure replicated correctly --- -"--- Insert into t1 --" as ""; ---- Select from t1 on master --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Select from t1 on slave --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Update t1 on master -- -UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; ---- Check the update on master --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Check Update on slave --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Remove a record from t1 on master --- -DELETE FROM t1 WHERE id = 42; ---- Show current count on master for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 ---- Show current count on slave for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 -DELETE FROM t1; ---- End test 2 partition RANGE testing --- ---- Do Cleanup --- -DROP TABLE IF EXISTS t1; ---- Start test 3 partition LIST testing --- ---- Do setup --- -CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63), -bc CHAR(63), d DECIMAL(10,4) DEFAULT 0, -f FLOAT DEFAULT 0, total BIGINT UNSIGNED, -y YEAR, t DATE) -TABLESPACE ts1 STORAGE DISK -ENGINE=NDB -PARTITION BY LIST(id) -(PARTITION p0 VALUES IN (2, 4), -PARTITION p1 VALUES IN (42, 142)); ---- Test 3 Alter to add partition --- -ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES IN (412)); ---- Show table on master --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(63) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned DEFAULT NULL, - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) ---- Show table on slave --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(63) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned DEFAULT NULL, - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) ---- Perform basic operation on master --- ---- and ensure replicated correctly --- -"--- Insert into t1 --" as ""; ---- Select from t1 on master --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Select from t1 on slave --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Update t1 on master -- -UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; ---- Check the update on master --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Check Update on slave --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Remove a record from t1 on master --- -DELETE FROM t1 WHERE id = 42; ---- Show current count on master for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 ---- Show current count on slave for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 -DELETE FROM t1; ---- Check that simple Alter statements are replicated correctly --- -ALTER TABLE t1 MODIFY vc VARCHAR(255); ---- Show the new improved table on the master --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(255) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned DEFAULT NULL, - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) ---- Make sure that our tables on slave are still same engine --- ---- and that the alter statements replicated correctly --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(255) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned DEFAULT NULL, - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY LIST (id) (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) ---- Perform basic operation on master --- ---- and ensure replicated correctly --- -"--- Insert into t1 --" as ""; ---- Select from t1 on master --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Select from t1 on slave --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Update t1 on master -- -UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; ---- Check the update on master --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Check Update on slave --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Remove a record from t1 on master --- -DELETE FROM t1 WHERE id = 42; ---- Show current count on master for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 ---- Show current count on slave for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 -DELETE FROM t1; ---- End test 3 partition LIST testing --- ---- Do Cleanup -- -DROP TABLE IF EXISTS t1; ---- Start test 4 partition HASH testing --- ---- Do setup --- -CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63), -bc CHAR(63), d DECIMAL(10,4) DEFAULT 0, -f FLOAT DEFAULT 0, total BIGINT UNSIGNED, -y YEAR, t DATE) -TABLESPACE ts1 STORAGE DISK -ENGINE=NDB -PARTITION BY HASH( YEAR(t) ) -PARTITIONS 4; ---- show that tables have been created correctly --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(63) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned DEFAULT NULL, - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL -) TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(63) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned DEFAULT NULL, - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL -) TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 ---- Perform basic operation on master --- ---- and ensure replicated correctly --- -"--- Insert into t1 --" as ""; ---- Select from t1 on master --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Select from t1 on slave --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Update t1 on master -- -UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; ---- Check the update on master --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Check Update on slave --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Remove a record from t1 on master --- -DELETE FROM t1 WHERE id = 42; ---- Show current count on master for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 ---- Show current count on slave for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 -DELETE FROM t1; ---- Check that simple Alter statements are replicated correctly --- -ALTER TABLE t1 MODIFY vc VARCHAR(255); ---- Show the new improved table on the master --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(255) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned DEFAULT NULL, - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 ---- Make sure that our tables on slave are still same engine --- ---- and that the alter statements replicated correctly --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(255) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned DEFAULT NULL, - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH ( YEAR(t)) PARTITIONS 4 ---- Perform basic operation on master --- ---- and ensure replicated correctly --- -"--- Insert into t1 --" as ""; ---- Select from t1 on master --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Select from t1 on slave --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Update t1 on master -- -UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; ---- Check the update on master --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Check Update on slave --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Remove a record from t1 on master --- -DELETE FROM t1 WHERE id = 42; ---- Show current count on master for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 ---- Show current count on slave for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 -DELETE FROM t1; ---- End test 4 partition HASH testing --- ---- Do Cleanup -- -DROP TABLE IF EXISTS t1; ---- Start test 5 partition by key testing --- ---- Create Table Section --- -CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63), -bc CHAR(63), d DECIMAL(10,4) DEFAULT 0, -f FLOAT DEFAULT 0, total BIGINT UNSIGNED, -y YEAR, t DATE,PRIMARY KEY(id)) -TABLESPACE ts1 STORAGE DISK -ENGINE=NDB -PARTITION BY KEY() -PARTITIONS 4; ---- Show that tables on master are ndbcluster tables --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(63) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned DEFAULT NULL, - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL, - PRIMARY KEY (`id`) -) TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ---- Show that tables on slave --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(63) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned DEFAULT NULL, - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL, - PRIMARY KEY (`id`) -) TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ---- Perform basic operation on master --- ---- and ensure replicated correctly --- -"--- Insert into t1 --" as ""; ---- Select from t1 on master --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Select from t1 on slave --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Update t1 on master -- -UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; ---- Check the update on master --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Check Update on slave --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Remove a record from t1 on master --- -DELETE FROM t1 WHERE id = 42; ---- Show current count on master for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 ---- Show current count on slave for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 -DELETE FROM t1; ---- Check that simple Alter statements are replicated correctly --- -ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total); ---- Show the new improved table on the master --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(63) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned NOT NULL DEFAULT '0', - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL, - PRIMARY KEY (`id`,`total`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ---- Make sure that our tables on slave are still right type --- ---- and that the alter statements replicated correctly --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(63) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned NOT NULL DEFAULT '0', - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL, - PRIMARY KEY (`id`,`total`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ---- Perform basic operation on master --- ---- and ensure replicated correctly --- -"--- Insert into t1 --" as ""; ---- Select from t1 on master --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Select from t1 on slave --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Update t1 on master -- -UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; ---- Check the update on master --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Check Update on slave --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Remove a record from t1 on master --- -DELETE FROM t1 WHERE id = 42; ---- Show current count on master for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 ---- Show current count on slave for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 -DELETE FROM t1; ---- Check that simple Alter statements are replicated correctly --- -ALTER TABLE t1 MODIFY vc VARCHAR(255); ---- Show the new improved table on the master --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(255) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned NOT NULL DEFAULT '0', - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL, - PRIMARY KEY (`id`,`total`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ---- Make sure that our tables on slave are still same engine --- ---- and that the alter statements replicated correctly --- -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `id` mediumint(9) NOT NULL, - `b1` bit(8) DEFAULT NULL, - `vc` varchar(255) DEFAULT NULL, - `bc` char(63) DEFAULT NULL, - `d` decimal(10,4) DEFAULT '0.0000', - `f` float DEFAULT '0', - `total` bigint(20) unsigned NOT NULL DEFAULT '0', - `y` year(4) DEFAULT NULL, - `t` date DEFAULT NULL, - PRIMARY KEY (`id`,`total`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY () PARTITIONS 4 ---- Perform basic operation on master --- ---- and ensure replicated correctly --- -"--- Insert into t1 --" as ""; ---- Select from t1 on master --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Select from t1 on slave --- -select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; -id hex(b1) vc bc d f total y t -2 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1965-11-14 -4 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1985-11-14 -42 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1905-11-14 -142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14 -412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14 ---- Update t1 on master -- -UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; ---- Check the update on master --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Check Update on slave --- -SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; -id hex(b1) vc bc d f total y t -412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22 ---- Remove a record from t1 on master --- -DELETE FROM t1 WHERE id = 42; ---- Show current count on master for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 ---- Show current count on slave for t1 --- -SELECT COUNT(*) FROM t1; -COUNT(*) -4 -DELETE FROM t1; ---- End test 5 key partition testing --- ---- Do Cleanup --- -DROP TABLE IF EXISTS t1; -alter tablespace ts1 -drop datafile 'datafile.dat' -engine=ndb; -alter tablespace ts1 -drop datafile 'datafile02.dat' -engine=ndb; -DROP TABLESPACE ts1 ENGINE=NDB; -DROP LOGFILE GROUP lg1 ENGINE=NDB; diff --git a/mysql-test/suite/parts/t/disabled.def b/mysql-test/suite/parts/t/disabled.def index d7c7dba6204..c2707f5a763 100644 --- a/mysql-test/suite/parts/t/disabled.def +++ b/mysql-test/suite/parts/t/disabled.def @@ -1,22 +1,11 @@ -ndb_blob_partition : cannot create t1 -ndb_dd_backuprestore : cannot create t1 -ndb_partition_error : cannot create t1 -ndb_partition_list : cannot create t1 -ndb_partition_range : cannot create t1 -part_supported_sql_func_ndb : cannot create t1 -partition_alter1_1_ndb : test works, but runs too long on PB -partition_alter1_1_2_ndb : test works, but runs too long on PB -partition_alter1_2_ndb : test works, but runs too long on PB -partition_alter2_ndb : cannot create t1 -partition_basic_ndb : cannot create t1 -partition_bit_ndb : cannot create t1 -partition_engine_ndb : cannot create t1 -partition_int_ndb : cannot create t1 +partition_alter2_ndb : Bug#18735 Not supported +partition_basic_ndb : Bug#19899 Crashing the server +# http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-limitations-syntax.html +partition_bit_ndb : NDB does not support bit column in index partition_sessions : needs system_3_init.inc -partition_syntax_ndb : cannot create t1 +partition_syntax_ndb : Bug#36735 Not supported partition_value_innodb : Bug#30581 partition_value tests use disallowed CAST() function partition_value_myisam : Bug#30581 partition_value tests use disallowed CAST() function -partition_value_ndb : cannot create t1 -rpl_ndb_dd_partitions : cannot create t1 +partition_value_ndb : Bug#30581 partition_value tests use disallowed CAST() function partition_alter4_myisam : Bug#20129 / WL#4176 partition_alter4_innodb : Bug#20129 / WL#4176 diff --git a/mysql-test/suite/parts/t/ndb_blob_partition.test b/mysql-test/suite/parts/t/ndb_blob_partition.test deleted file mode 100644 index a3948cc9491..00000000000 --- a/mysql-test/suite/parts/t/ndb_blob_partition.test +++ /dev/null @@ -1,93 +0,0 @@ ---source include/have_ndb.inc --- source include/not_embedded.inc - ---disable_warnings -drop table if exists t1; ---enable_warnings - -# -# Minimal NDB blobs test with range partitions. -# - -create table t1 ( - a mediumint not null, - b text not null, - c int not null, - d longblob, - primary key using hash (a,c), - unique key (c) -) - engine=ndb - partition by range (c) - partitions 3 - ( partition p1 values less than (200), - partition p2 values less than (300), - partition p3 values less than (400)); - ---disable_query_log -sleep 1; - -# length 61 -set @s0 = 'rggurloniukyehuxdbfkkyzlceixzrehqhvxvxbpwizzvjzpucqmzrhzxzfau'; -set @s1 = 'ykyymbzqgqlcjhlhmyqelfoaaohvtbekvifukdtnvcrrjveevfakxarxexomz'; -set @s2 = 'dbnfqyzgtqxalcrwtfsqabknvtfcbpoonxsjiqvmhnfikxxhcgoexlkoezvah'; - -set @v1 = repeat(@s0, 100); -- 1d42dd9090cf78314a06665d4ea938c35cc760f4 -set @v2 = repeat(@s1, 200); -- 10d3c783026b310218d10b7188da96a2401648c6 -set @v3 = repeat(@s2, 300); -- a33549d9844092289a58ac348dd59f09fc28406a -set @v4 = repeat(@s0, 400); -- daa61c6de36a0526f0d47dc29d6b9de7e6d2630c -set @v5 = repeat(@s1, 500); -- 70fc9a7d08beebc522258bfb02000a30c77a8f1d -set @v6 = repeat(@s2, 600); -- 090565c580809efed3d369481a4bbb168b20713e -set @v7 = repeat(@s0, 700); -- 1e0070bec426871a46291de27b9bd6e4255ab4e5 -set @v8 = repeat(@s1, 800); -- acbaba01bc2e682f015f40e79d9cbe475db3002e -set @v9 = repeat(@s2, 900); -- 9ee30d99162574f79c66ae95cdf132dcf9cbc259 ---enable_query_log - -# -- insert -- -insert into t1 values (1, @v1, 101, @v2); -insert into t1 values (1, @v2, 102, @v3); -insert into t1 values (1, @v3, 103, @v4); -insert into t1 values (2, @v4, 201, @v5); -insert into t1 values (2, @v5, 202, @v6); -insert into t1 values (2, @v6, 203, @v7); -insert into t1 values (3, @v7, 301, @v8); -insert into t1 values (3, @v8, 302, @v9); -insert into t1 values (3, @v9, 303, @v1); -select a, sha1(b), c, sha1(d) from t1 order by a; - -# -- pk read -- -select a, sha1(b), c, sha1(d) from t1 where a = 1 and c = 101; -select a, sha1(b), c, sha1(d) from t1 where a = 2 and c = 201; -select a, sha1(b), c, sha1(d) from t1 where a = 3 and c = 301; - -# -- pk update -- -update t1 set b = @v3, d = @v4 where a = 1 and c = 102; -update t1 set b = @v6, d = @v7 where a = 2 and c = 202; -update t1 set b = @v9, d = @v1 where a = 3 and c = 302; -select a, sha1(b), c, sha1(d) from t1 order by a; - -# -- hash index update -- -update t1 set b = @v4, d = @v5 where c = 103; -update t1 set b = @v7, d = @v8 where c = 203; -update t1 set b = @v1, d = @v2 where c = 303; -select a, sha1(b), c, sha1(d) from t1 order by a; - -# -- full scan update -- -update t1 set b = @v5, d = @v6; -select a, sha1(b), c, sha1(d) from t1 order by a; - -# -- range scan update -update t1 set b = @v1, d = @v2 where 100 < c and c < 200; -update t1 set b = @v4, d = @v5 where 200 < c and c < 300; -update t1 set b = @v7, d = @v8 where 300 < c and c < 400; -select a, sha1(b), c, sha1(d) from t1 order by a; - -# -- delete -- -delete from t1 where a = 1 and c = 101; -delete from t1 where c = 102; -# delete from t1 where c < 300; # XXX coredump -delete from t1; -select a, sha1(b), c, sha1(d) from t1 order by a; - -# -- clean up -- -drop table t1; diff --git a/mysql-test/suite/parts/t/ndb_dd_backuprestore.test b/mysql-test/suite/parts/t/ndb_dd_backuprestore.test index be6d73e27b4..d2f79028c3f 100644 --- a/mysql-test/suite/parts/t/ndb_dd_backuprestore.test +++ b/mysql-test/suite/parts/t/ndb_dd_backuprestore.test @@ -5,6 +5,10 @@ ######################################## -- source include/have_ndb.inc +# range, list and hash partitioning in ndb requires new_mode +--disable_query_log +set new=on; +--enable_query_log --disable_warnings DROP TABLE IF EXISTS test.t1; diff --git a/mysql-test/suite/parts/t/ndb_partition_error.test b/mysql-test/suite/parts/t/ndb_partition_error.test deleted file mode 100644 index 06581f1270f..00000000000 --- a/mysql-test/suite/parts/t/ndb_partition_error.test +++ /dev/null @@ -1,71 +0,0 @@ --- source include/have_ndb.inc -#--disable_abort_on_error -# -# Simple test for the partition storage engine -# Focuses on range partitioning tests -# -#-- source include/have_partition.inc - ---disable_warnings -drop table if exists t1; ---enable_warnings - -# -# Partition by range, generate node group error -# ---error 1005 -CREATE TABLE t1 ( -a int not null, -b int not null, -c int not null, -primary key(a,b), -index (a)) -engine = ndb -partition by range (a) -partitions 3 -(partition x1 values less than (5) nodegroup 12, - partition x2 values less than (10) nodegroup 13, - partition x3 values less than (20) nodegroup 14); -show warnings; - -# -# Partition by range, create normal valid table -# -CREATE TABLE t1 ( -a int not null, -b int not null, -c int not null, -primary key(a)) -engine = ndb -partition by range (a) -partitions 3 -(partition x1 values less than (5), - partition x2 values less than (10), - partition x3 values less than (20)); - -drop table t1; - -# -# Bug #17763 mysqld cores with list partitioning if update to missing partition -# -CREATE TABLE t1 (id INT) ENGINE=NDB - PARTITION BY LIST(id) - (PARTITION p0 VALUES IN (2, 4), - PARTITION p1 VALUES IN (42, 142)); -INSERT INTO t1 VALUES (2); ---error ER_NO_PARTITION_FOR_GIVEN_VALUE -UPDATE t1 SET id=5 WHERE id=2; -DROP TABLE t1; - -# -# NULL for LIST partition -# -create table t1 (a int,b int, c int) -engine = ndb -partition by list(a) -partitions 2 -(partition x123 values in (11, 12), - partition x234 values in (5, 1)); ---error ER_NO_PARTITION_FOR_GIVEN_VALUE -insert into t1 values (NULL,1,1); -drop table t1; diff --git a/mysql-test/suite/parts/t/ndb_partition_key.test b/mysql-test/suite/parts/t/ndb_partition_key.test deleted file mode 100644 index 36a8a1863aa..00000000000 --- a/mysql-test/suite/parts/t/ndb_partition_key.test +++ /dev/null @@ -1,208 +0,0 @@ --- source include/have_ndb.inc - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - -# -# Basic syntax test -# - -# Support for partition key verified -CREATE TABLE t1 (a int, b int, c int, d int, PRIMARY KEY(a,b,c)) - ENGINE = NDB - PARTITION BY KEY (a,b); - -insert into t1 values (1,1,1,1); -select * from t1; -update t1 set d = 2 where a = 1 and b = 1 and c = 1; -select * from t1; -delete from t1; -select * from t1; - -drop table t1; - -# only support for partition key on primary key ---error ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF -CREATE TABLE t1 (a int, b int, c int, d int, PRIMARY KEY(a,b)) - ENGINE = NDB - PARTITION BY KEY (c); - -CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY(a,b)) - ENGINE = NDB - PARTITION BY KEY (a); - -insert into t1 values - (1,1,3),(1,2,3),(1,3,3),(1,4,3),(1,5,3),(1,6,3), - (1,7,3),(1,8,3),(1,9,3),(1,10,3),(1,11,3),(1,12,3); - -select * from t1 order by b; - -DROP TABLE t1; - -# -# Test partition and char support -# - -CREATE TABLE t1 (a INT, b CHAR(10) COLLATE latin1_bin, c INT, d INT, - PRIMARY KEY (a,b,c) USING HASH) - ENGINE=NDB - DEFAULT CHARSET=latin1 - PARTITION BY KEY (b); - -insert into t1 values (1,"a",1,1),(2,"a",1,1),(3,"a",1,1); - -# should show only one attribute with DISTRIBUTION KEY ---exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -d test t1 | sed 's/Version: [0-9]*//' | sed 's/\(Length of frm data: \)[0-9]*/\1#/' - -# -# Test that explicit partition info is not shown in show create table -# result should not contain (PARTITION P0 ... etc) since this is what shows up in -# mysqldump, and we don't want that info there -# -show create table t1; - -DROP TABLE t1; - -# -# Bug #13155: Problem in Create Table using SHOW CREATE TABLE syntax -# -CREATE TABLE t1 (a int not null primary key) -PARTITION BY KEY(a) -(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB); - -drop table t1; - -CREATE TABLE t1 (a int not null primary key); -ALTER TABLE t1 -ENGINE = NDB -PARTITION BY KEY(a) -(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB); - -drop table t1; - -CREATE TABLE t1 (a int not null primary key) ENGINE = NDB; -ALTER TABLE t1 -PARTITION BY KEY(a) -(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB); - -drop table t1; - -# -# Bug #17754 Improper handling of removal of partitioning in ALTER TABLE -# Also added a number of general test cases in the same area -# -create table t1 (a int) -engine=ndb -partition by key(a) -(partition p0, partition p1); -show create table t1; - -alter table t1 engine=heap; -show create table t1; - -alter table t1 engine=ndb; -show create table t1; - -alter table t1 engine=heap remove partitioning; -show create table t1; - -alter table t1 engine=ndb -partition by key(a) -(partition p0, partition p1 engine = ndb); -show create table t1; - -alter table t1 -partition by key (a) -(partition p0 engine=ndb, partition p1 engine=ndb); -show create table t1; - -alter table t1 remove partitioning; -show create table t1; - -#--error ER_MIX_HANDLER_ERROR -# after fixing bug#31931 this works -# since it already have ndb on table level -alter table t1 -partition by key(a) -(partition p0 engine=ndb, partition p1); - -alter table t1 -engine=ndb -partition by key(a) -(partition p0 engine=ndb, partition p1 engine = ndb); -show create table t1; - -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; - -# -# Bug 16822: OPTIMIZE TABLE hangs test -# -CREATE TABLE t1 (a int primary key) -ENGINE=NDB -PARTITION BY KEY(a); ---error 1031 -ALTER TABLE t1 OPTIMIZE PARTITION p0; ---error 1031 -ALTER TABLE t1 CHECK PARTITION p0; ---error 1031 -ALTER TABLE t1 REPAIR PARTITION p0; ---error 1031 -ALTER TABLE t1 ANALYZE PARTITION p0; ---error 1031 -ALTER TABLE t1 REBUILD PARTITION p0; -DROP TABLE t1; - -# -# BUG 16806: ALTER TABLE fails -# -CREATE TABLE t1 ( - c1 MEDIUMINT NOT NULL AUTO_INCREMENT, - c2 TEXT NOT NULL, - c3 INT NOT NULL, - PRIMARY KEY(c1,c3)) - ENGINE=NDB - PARTITION BY KEY(c3) PARTITIONS 5; - -ALTER TABLE t1 ADD COLUMN c4 INT AFTER c1; -DROP TABLE t1; - -CREATE TABLE t1 ( - c1 MEDIUMINT NOT NULL AUTO_INCREMENT, - c2 TEXT NOT NULL, - c3 INT NOT NULL, - PRIMARY KEY(c1,c3)) - ENGINE=NDB - PARTITION BY KEY(c3); - -ALTER TABLE t1 ADD COLUMN c4 INT AFTER c1; -DROP TABLE t1; diff --git a/mysql-test/suite/parts/t/ndb_partition_list.test b/mysql-test/suite/parts/t/ndb_partition_list.test deleted file mode 100644 index 2ad37b8768c..00000000000 --- a/mysql-test/suite/parts/t/ndb_partition_list.test +++ /dev/null @@ -1,64 +0,0 @@ ---source include/have_ndb.inc -# -# Simple test for the partition storage engine -# Focuses on range partitioning tests -# -#-- source include/have_partition.inc - ---disable_warnings -drop table if exists t1; ---enable_warnings - -# -# Partition by list, basic -# - -CREATE TABLE t1 ( f_int1 INTEGER NOT NULL, f_int2 INTEGER NOT NULL, - f_char1 CHAR(10), - f_char2 CHAR(10), f_charbig VARCHAR(1000), -PRIMARY KEY (f_int1,f_int2)) -ENGINE = NDB -PARTITION BY LIST(MOD(f_int1 + f_int2,4)) -(PARTITION part_3 VALUES IN (-3), - PARTITION part_2 VALUES IN (-2), - PARTITION part_1 VALUES IN (-1), - PARTITION part0 VALUES IN (0), - PARTITION part1 VALUES IN (1), - PARTITION part2 VALUES IN (2), - PARTITION part3 VALUES IN (3,4,5)); - -INSERT INTO t1 SET f_int1 = -2, f_int2 = 20, f_char1 = '20', f_char2 = '20', f_charbig = '===20==='; -INSERT INTO t1 SET f_int1 = 1, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -INSERT INTO t1 SET f_int1 = 2, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -INSERT INTO t1 SET f_int1 = 3, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -INSERT INTO t1 SET f_int1 = 4, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -INSERT INTO t1 SET f_int1 = 5, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -INSERT INTO t1 SET f_int1 = 20, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; - -SELECT * FROM t1 ORDER BY f_int1; - -DROP TABLE t1; - -# -# Partition by list, no pk -# - -CREATE TABLE t1 ( f_int1 INTEGER, f_int2 INTEGER, f_char1 CHAR(10), - f_char2 CHAR(10), f_charbig VARCHAR(1000)) -ENGINE = NDB -PARTITION BY LIST(f_int1) -(PARTITION part_1 VALUES IN (-1), - PARTITION part0 VALUES IN (0,1), - PARTITION part1 VALUES IN (2)); - -INSERT INTO t1 SET f_int1 = -1, f_int2 = 20, f_char1 = '20', f_char2 = '20', f_charbig = '===20==='; -INSERT INTO t1 SET f_int1 = 0, f_int2 = 20, f_char1 = '20', f_char2 = '20', f_charbig = '===20==='; -INSERT INTO t1 SET f_int1 = 1, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; -INSERT INTO t1 SET f_int1 = 2, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; ---error ER_NO_PARTITION_FOR_GIVEN_VALUE -INSERT INTO t1 SET f_int1 = 20, f_int2 = 1, f_char1 = '1', f_char2 = '1', f_charbig = '===1==='; - -SELECT * FROM t1 ORDER BY f_int1; - -DROP TABLE t1; - diff --git a/mysql-test/suite/parts/t/ndb_partition_range.test b/mysql-test/suite/parts/t/ndb_partition_range.test deleted file mode 100644 index 981467d4055..00000000000 --- a/mysql-test/suite/parts/t/ndb_partition_range.test +++ /dev/null @@ -1,260 +0,0 @@ --- source include/have_ndb.inc -#--disable_abort_on_error -# -# Simple test for the partition storage engine -# Focuses on range partitioning tests -# -#-- source include/have_partition.inc - ---disable_warnings -drop table if exists t1; ---enable_warnings - -# -# Partition by range, basic -# -CREATE TABLE t1 ( -a int not null, -b int not null, -c int not null, -primary key(a,b), -index (a)) -engine = ndb -partition by range (a) -partitions 3 -(partition x1 values less than (5), - partition x2 values less than (10), - partition x3 values less than (20)); - -# Simple insert and verify test -INSERT into t1 values (1, 1, 1); -INSERT into t1 values (6, 1, 1); -INSERT into t1 values (10, 1, 1); -INSERT into t1 values (15, 1, 1); - ---replace_column 16 # 19 # 20 # -select * from information_schema.partitions where table_name= 't1'; - -select * from t1 order by a; - -select * from t1 where a=1 order by a; -select * from t1 where a=15 and b=1 order by a; -select * from t1 where a=21 and b=1 order by a; -select * from t1 where a=21 order by a; -select * from t1 where a in (1,6,10,21) order by a; -select * from t1 where b=1 and a in (1,6,10,21) order by a; - -drop table t1; - -# -# Partition by range, basic -# -CREATE TABLE t1 ( -a int not null, -b int not null, -c int not null, -primary key(b), -unique (a)) -engine = ndb -partition by range (b) -partitions 3 -(partition x1 values less than (5), - partition x2 values less than (10), - partition x3 values less than (20)); - -# Simple insert and verify test -INSERT into t1 values (1, 1, 1); -INSERT into t1 values (2, 6, 1); -INSERT into t1 values (3, 10, 1); -INSERT into t1 values (4, 15, 1); - -select * from t1 order by a; -UPDATE t1 set a = 5 WHERE b = 15; -select * from t1 order by a; -UPDATE t1 set a = 6 WHERE a = 5; -select * from t1 order by a; - -select * from t1 where b=1 order by b; -select * from t1 where b=15 and a=1 order by b; -select * from t1 where b=21 and a=1 order by b; -select * from t1 where b=21 order by b; -select * from t1 where b in (1,6,10,21) order by b; -select * from t1 where a in (1,2,5,6) order by b; -select * from t1 where a=1 and b in (1,6,10,21) order by b; - -DELETE from t1 WHERE b = 6; -DELETE from t1 WHERE a = 6; - -# -# Test that explicit partition info _is_ shown in show create table -# result _should_ contain (PARTITION x1 ... etc) -# -show create table t1; - -drop table t1; - -# -# Bug #17499, #17687 -# Alter partitioned NDB table causes mysqld to core -# - -CREATE TABLE t1 - (id MEDIUMINT NOT NULL, - b1 BIT(8), - vc VARCHAR(255), - bc CHAR(255), - d DECIMAL(10,4) DEFAULT 0, - f FLOAT DEFAULT 0, - total BIGINT UNSIGNED, - y YEAR, - t DATE) ENGINE=NDB - PARTITION BY RANGE (YEAR(t)) - (PARTITION p0 VALUES LESS THAN (1901), - PARTITION p1 VALUES LESS THAN (1946), - PARTITION p2 VALUES LESS THAN (1966), - PARTITION p3 VALUES LESS THAN (1986), - PARTITION p4 VALUES LESS THAN (2005), - PARTITION p5 VALUES LESS THAN MAXVALUE); - -INSERT INTO t1 VALUES (0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); -SELECT * FROM t1; -ALTER TABLE t1 ENGINE=MYISAM; -SELECT * FROM t1; -DROP TABLE t1; - -CREATE LOGFILE GROUP lg1 - ADD UNDOFILE 'undofile.dat' - INITIAL_SIZE 16M - UNDO_BUFFER_SIZE=1M - ENGINE=NDB; - -CREATE TABLESPACE ts1 - ADD DATAFILE 'datafile.dat' - USE LOGFILE GROUP lg1 - INITIAL_SIZE 12M - ENGINE NDB; - -CREATE TABLE test.t1 ( - a1 INT, - a2 TEXT NOT NULL, - a3 BIT NOT NULL, - a4 DECIMAL(8,3), - a5 INT NOT NULL, - a6 INT, - PRIMARY KEY(a1)) - TABLESPACE ts1 STORAGE DISK ENGINE=NDB - PARTITION BY LIST (a1) - (PARTITION p0 VALUES IN (1,2,3,4,5), - PARTITION p1 VALUES IN (6,7,8,9, 10), - PARTITION p2 VALUES IN (11, 12, 13, 14, 15)); - -# Alter table directly without any statements inbetween -ALTER TABLE test.t1 DROP COLUMN a6; -ALTER TABLE test.t1 ADD COLUMN a6 VARCHAR(255); - -let $j= 15; ---disable_query_log -while ($j) -{ -eval INSERT INTO test.t1 VALUES ($j, "Tested Remotely from Texas, USA", -b'1',$j.00,$j+1,"By NIK $j"); -dec $j; -} ---enable_query_log -SELECT COUNT(*) FROM test.t1; - -ALTER TABLE test.t1 DROP COLUMN a4; -SELECT COUNT(*) FROM test.t1; - -DROP TABLE t1; - -CREATE TABLE test.t1 ( - a1 INT, - a2 TEXT NOT NULL, - a3 BIT NOT NULL, - a4 DECIMAL(8,3), - a5 INT NOT NULL, - a6 VARCHAR(255), - PRIMARY KEY(a1)) - TABLESPACE ts1 STORAGE DISK ENGINE=NDB - PARTITION BY HASH(a1) - PARTITIONS 4; - -let $j= 15; ---disable_query_log -while ($j) -{ -eval INSERT INTO test.t1 VALUES ($j, "Tested Remotely from Texas, USA", -b'1',$j.00,$j+1,"By NIK $j"); -dec $j; -} ---enable_query_log -SELECT COUNT(*) FROM test.t1; - -ALTER TABLE test.t1 DROP COLUMN a4; -SELECT COUNT(*) FROM test.t1; - -DROP TABLE t1; - -ALTER TABLESPACE ts1 - DROP DATAFILE 'datafile.dat' - ENGINE=NDB; -DROP TABLESPACE ts1 ENGINE=NDB; -DROP LOGFILE GROUP lg1 ENGINE=NDB; - - -# -# Bug #17701 ALTER TABLE t1 ADD PARTITION for PARTITION BY LIST hangs test -# - -CREATE TABLE t1 - (id MEDIUMINT NOT NULL, - b1 BIT(8), - vc VARCHAR(255), - bc CHAR(255), - d DECIMAL(10,4) DEFAULT 0, - f FLOAT DEFAULT 0, - total BIGINT UNSIGNED, - y YEAR, - t DATE) ENGINE=NDB - PARTITION BY LIST(id) - (PARTITION p0 VALUES IN (2, 4), - PARTITION p1 VALUES IN (42, 142)); - -INSERT INTO t1 VALUES (2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); -SELECT * FROM t1; -ALTER TABLE t1 ADD PARTITION - (PARTITION p2 VALUES IN (412)); -SELECT * FROM t1; -DROP TABLE t1; - -# -# Bug #17806 Update on NDB table with list partition causes mysqld to core -# Bug #16385 Partitions: crash when updating a range partitioned NDB table -# -CREATE TABLE t1 ( -a int not null, -b int not null, -c int not null) -partition by list(a) -partitions 2 -(partition x123 values in (1,5,6), - partition x234 values in (4,7,8)); -INSERT into t1 VALUES (5,1,1); -select * from t1; -UPDATE t1 SET a=8 WHERE a=5 AND b=1; -select * from t1; -drop table t1; - -CREATE TABLE t1 ( f1 INTEGER, f2 char(20)) engine=ndb -PARTITION BY RANGE(f1) -( PARTITION part1 VALUES LESS THAN (2), -PARTITION part2 VALUES LESS THAN (1000)); -INSERT INTO t1 VALUES(1, '---1---'); -INSERT INTO t1 VALUES(2, '---2---'); -select * from t1 order by f1; -UPDATE t1 SET f1 = f1 + 4 WHERE f1 = 2; -select * from t1 order by f1; -UPDATE t1 SET f1 = f1 + 4 WHERE f1 = 1; -select * from t1 order by f1; -drop table t1; diff --git a/mysql-test/suite/parts/t/part_supported_sql_func_ndb.test b/mysql-test/suite/parts/t/part_supported_sql_func_ndb.test index c21649ba396..5ac6b2a504f 100644 --- a/mysql-test/suite/parts/t/part_supported_sql_func_ndb.test +++ b/mysql-test/suite/parts/t/part_supported_sql_func_ndb.test @@ -1,5 +1,5 @@ ################################################################################ -# t/part_supported_sql_funcs_myisam.test # +# t/part_supported_sql_funcs_ndb.test # # # # Purpose: # # Tests which SQL functions are allowed in partinioning clauses with # @@ -33,6 +33,14 @@ let $do_long_tests= 1; ##### Storage engine to be tested --source include/have_ndb.inc let $engine= 'NDB'; +connection default; +# range, list and hash partitioning in ndb requires new_mode +--disable_query_log +set new=on; +--enable_query_log +let $max_8_partitions= 1; +let $no_reorg_partition= 1; +let $drop_partition_not_supported= 1; #------------------------------------------------------------------------------# --source suite/parts/inc/part_supported_sql_funcs_main.inc diff --git a/mysql-test/suite/parts/t/partition_alter1_1_2_ndb.test b/mysql-test/suite/parts/t/partition_alter1_1_2_ndb.test index 29f801afb09..1a8f1f311b6 100644 --- a/mysql-test/suite/parts/t/partition_alter1_1_2_ndb.test +++ b/mysql-test/suite/parts/t/partition_alter1_1_2_ndb.test @@ -26,6 +26,7 @@ #------------------------------------------------------------------------------# # General not engine specific settings and requirements +--source include/big_test.inc ##### Options, for debugging support ##### let $debug= 0; diff --git a/mysql-test/suite/parts/t/partition_alter1_1_ndb.test b/mysql-test/suite/parts/t/partition_alter1_1_ndb.test index fa6f99f8efe..1a031f0ef79 100644 --- a/mysql-test/suite/parts/t/partition_alter1_1_ndb.test +++ b/mysql-test/suite/parts/t/partition_alter1_1_ndb.test @@ -26,6 +26,7 @@ #------------------------------------------------------------------------------# # General not engine specific settings and requirements +--source include/big_test.inc ##### Options, for debugging support ##### let $debug= 0; diff --git a/mysql-test/suite/parts/t/partition_alter1_2_ndb.test b/mysql-test/suite/parts/t/partition_alter1_2_ndb.test index f2e220cd5ab..497898fb089 100644 --- a/mysql-test/suite/parts/t/partition_alter1_2_ndb.test +++ b/mysql-test/suite/parts/t/partition_alter1_2_ndb.test @@ -27,6 +27,7 @@ #------------------------------------------------------------------------------# # General not engine specific settings and requirements +--source include/big_test.inc ##### Options, for debugging support ##### let $debug= 0; diff --git a/mysql-test/suite/parts/t/partition_alter2_ndb.test b/mysql-test/suite/parts/t/partition_alter2_ndb.test index e9b4da93b7a..fd1437ede71 100644 --- a/mysql-test/suite/parts/t/partition_alter2_ndb.test +++ b/mysql-test/suite/parts/t/partition_alter2_ndb.test @@ -50,7 +50,12 @@ let $more_pk_ui_tests= 0; ##### Storage engine to be tested --source include/have_ndb.inc let $engine= 'ndbcluster'; +connection default; +# range, list and hash partitioning in ndb requires new_mode +--disable_query_log +set new=on; +--enable_query_log ##### Execute the test of "table" files # NDB has no files per PK, UI, ... let $do_file_tests= 0; diff --git a/mysql-test/suite/parts/t/partition_basic_ndb.test b/mysql-test/suite/parts/t/partition_basic_ndb.test index 273d92ac80d..48e569006de 100644 --- a/mysql-test/suite/parts/t/partition_basic_ndb.test +++ b/mysql-test/suite/parts/t/partition_basic_ndb.test @@ -50,7 +50,12 @@ let $more_pk_ui_tests= 0; ##### Storage engine to be tested --source include/have_ndb.inc let $engine= 'ndbcluster'; +connection default; +# range, list and hash partitioning in ndb requires new_mode +--disable_query_log +set new=on; +--enable_query_log ##### Execute the test of "table" files # NDB has no files per PK, UI, ... let $do_file_tests= 0; diff --git a/mysql-test/suite/parts/t/partition_bit_ndb.test b/mysql-test/suite/parts/t/partition_bit_ndb.test index 94e4119031c..227d3d53401 100644 --- a/mysql-test/suite/parts/t/partition_bit_ndb.test +++ b/mysql-test/suite/parts/t/partition_bit_ndb.test @@ -1,9 +1,9 @@ ################################################################################ -# t/partition_bit.test # +# t/partition_bit_ndb.test # # # # Purpose: # # Tests around bit type # -# MyISAM branch # +# NDB branch # # # #------------------------------------------------------------------------------# # Original Author: HH # @@ -45,7 +45,12 @@ SET @max_row = 20; ##### Storage engine to be tested --source include/have_ndb.inc let $engine= 'NDB'; +connection default; +# range, list and hash partitioning in ndb requires new_mode +--disable_query_log +set new=on; +--enable_query_log ##### Assign a big number smaller than the maximum value for partitions ##### # and smaller than the maximum value of SIGNED INTEGER let $MAX_VALUE= (2147483646); diff --git a/mysql-test/suite/parts/t/partition_engine_ndb.test b/mysql-test/suite/parts/t/partition_engine_ndb.test index 1e185c8ebaa..40d031eab69 100644 --- a/mysql-test/suite/parts/t/partition_engine_ndb.test +++ b/mysql-test/suite/parts/t/partition_engine_ndb.test @@ -49,7 +49,12 @@ let $more_pk_ui_tests= 0; ##### Storage engine to be tested let $engine= 'ndbcluster'; --source include/have_ndb.inc +connection default; +# range, list and hash partitioning in ndb requires new_mode +--disable_query_log +set new=on; +--enable_query_log ##### Execute the test of "table" files # NDB has no files per PK, UI, ... let $do_file_tests= 0; diff --git a/mysql-test/suite/parts/t/partition_int_ndb.test b/mysql-test/suite/parts/t/partition_int_ndb.test index 0a60408292a..5e464ff75b5 100644 --- a/mysql-test/suite/parts/t/partition_int_ndb.test +++ b/mysql-test/suite/parts/t/partition_int_ndb.test @@ -1,9 +1,9 @@ ################################################################################ -# t/partition_int_ndb.test # +# t/partition_int_ndb.test # # # # Purpose: # # Tests around integer type # -# NDB branch # +# NDB branch # # # #------------------------------------------------------------------------------# # Original Author: HH # @@ -37,7 +37,14 @@ let $debug= 0; ##### Storage engine to be tested --source include/have_ndb.inc let $engine= 'NDB'; +connection default; +##### max rows to be inserted +let $maxrows=1024; +# range, list and hash partitioning in ndb requires new_mode +--disable_query_log +set new=on; +--enable_query_log #------------------------------------------------------------------------------# # Execute the tests to be applied to all storage engines --source suite/parts/inc/partition_tinyint.inc diff --git a/mysql-test/suite/parts/t/partition_syntax_ndb.test b/mysql-test/suite/parts/t/partition_syntax_ndb.test index 90b74452ab1..c783e9f602e 100644 --- a/mysql-test/suite/parts/t/partition_syntax_ndb.test +++ b/mysql-test/suite/parts/t/partition_syntax_ndb.test @@ -49,7 +49,12 @@ let $more_pk_ui_tests= 0; ##### Storage engine to be tested --source include/have_ndb.inc let $engine= 'ndbcluster'; +connection default; +# range, list and hash partitioning in ndb requires new_mode +--disable_query_log +set new=on; +--enable_query_log ##### Execute the test of "table" files # NDB has no files per PK, UI, ... let $do_file_tests= 0; diff --git a/mysql-test/suite/parts/t/partition_value_ndb.test b/mysql-test/suite/parts/t/partition_value_ndb.test index 91497c3ec42..2f948b95727 100644 --- a/mysql-test/suite/parts/t/partition_value_ndb.test +++ b/mysql-test/suite/parts/t/partition_value_ndb.test @@ -49,7 +49,12 @@ let $more_pk_ui_tests= 0; ##### Storage engine to be tested --source include/have_ndb.inc let $engine= 'ndbcluster'; +connection default; +# range, list and hash partitioning in ndb requires new_mode +--disable_query_log +set new=on; +--enable_query_log ##### Execute the test of "table" files # NDB has no files per PK, UI, ... let $do_file_tests= 0; diff --git a/mysql-test/suite/parts/t/rpl_ndb_dd_partitions.test b/mysql-test/suite/parts/t/rpl_ndb_dd_partitions.test deleted file mode 100644 index 9291f38e8db..00000000000 --- a/mysql-test/suite/parts/t/rpl_ndb_dd_partitions.test +++ /dev/null @@ -1,310 +0,0 @@ -####################################### -# Author: JBM # -# Date: 2006-03-09 # -# Purpose: To test the replication of # -# Cluster Disk Data using partitions # -####################################### - ---source include/have_ndb.inc ---source include/have_binlog_format_row.inc ---source include/master-slave.inc - ---echo --- Doing pre test cleanup --- - -connection master; ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_query_log - - -# Start by creating a logfile group -################################## - -CREATE LOGFILE GROUP lg1 -ADD UNDOFILE 'undofile.dat' -INITIAL_SIZE 16M -UNDO_BUFFER_SIZE = 1M -ENGINE=NDB; - -ALTER LOGFILE GROUP lg1 -ADD UNDOFILE 'undofile02.dat' -INITIAL_SIZE = 4M -ENGINE=NDB; - -################################################### -# Create a tablespace connected to the logfile group -################################################### - -CREATE TABLESPACE ts1 -ADD DATAFILE 'datafile.dat' -USE LOGFILE GROUP lg1 -INITIAL_SIZE 12M -ENGINE NDB; - -ALTER TABLESPACE ts1 -ADD DATAFILE 'datafile02.dat' -INITIAL_SIZE = 4M -ENGINE=NDB; - -################################################################# - ---echo --- Start test 2 partition RANGE testing -- ---echo --- Do setup -- - - -################################################# -# Requirment: Create table that is partitioned # -# by range on year i.e. year(t) and replicate # -# basice operations such at insert, update # -# delete between 2 different storage engines # -# Alter table and ensure table is handled # -# Correctly on the slave # -################################################# - -CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63), - bc CHAR(63), d DECIMAL(10,4) DEFAULT 0, - f FLOAT DEFAULT 0, total BIGINT UNSIGNED, - y YEAR, t DATE) - TABLESPACE ts1 STORAGE DISK - ENGINE=NDB - PARTITION BY RANGE (YEAR(t)) - (PARTITION p0 VALUES LESS THAN (1901), - PARTITION p1 VALUES LESS THAN (1946), - PARTITION p2 VALUES LESS THAN (1966), - PARTITION p3 VALUES LESS THAN (1986), - PARTITION p4 VALUES LESS THAN (2005), - PARTITION p5 VALUES LESS THAN MAXVALUE); - ---echo --- Show table on master --- - -SHOW CREATE TABLE t1; - ---echo --- Show table on slave -- - -sync_slave_with_master; -SHOW CREATE TABLE t1; - ---echo --- Perform basic operation on master --- ---echo --- and ensure replicated correctly --- - ---source include/rpl_multi_engine3.inc - ---echo --- Check that simple Alter statements are replicated correctly --- - -ALTER TABLE t1 MODIFY vc VARCHAR(255); - ---echo --- Show the new improved table on the master --- - -SHOW CREATE TABLE t1; - ---echo --- Make sure that our tables on slave are still same engine --- ---echo --- and that the alter statements replicated correctly --- - -sync_slave_with_master; -SHOW CREATE TABLE t1; - ---echo --- Perform basic operation on master --- ---echo --- and ensure replicated correctly --- ---enable_query_log - ---source include/rpl_multi_engine3.inc - ---echo --- End test 2 partition RANGE testing --- ---echo --- Do Cleanup --- - -DROP TABLE IF EXISTS t1; - -######################################################## - ---echo --- Start test 3 partition LIST testing --- ---echo --- Do setup --- -################################################# - - -CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63), - bc CHAR(63), d DECIMAL(10,4) DEFAULT 0, - f FLOAT DEFAULT 0, total BIGINT UNSIGNED, - y YEAR, t DATE) - TABLESPACE ts1 STORAGE DISK - ENGINE=NDB - PARTITION BY LIST(id) - (PARTITION p0 VALUES IN (2, 4), - PARTITION p1 VALUES IN (42, 142)); - ---echo --- Test 3 Alter to add partition --- - -ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES IN (412)); - ---echo --- Show table on master --- - -SHOW CREATE TABLE t1; - ---echo --- Show table on slave --- - -sync_slave_with_master; -SHOW CREATE TABLE t1; - ---echo --- Perform basic operation on master --- ---echo --- and ensure replicated correctly --- - ---source include/rpl_multi_engine3.inc - ---echo --- Check that simple Alter statements are replicated correctly --- - -ALTER TABLE t1 MODIFY vc VARCHAR(255); - ---echo --- Show the new improved table on the master --- - -SHOW CREATE TABLE t1; - ---echo --- Make sure that our tables on slave are still same engine --- ---echo --- and that the alter statements replicated correctly --- - -sync_slave_with_master; -SHOW CREATE TABLE t1; - ---echo --- Perform basic operation on master --- ---echo --- and ensure replicated correctly --- - ---source include/rpl_multi_engine3.inc - ---echo --- End test 3 partition LIST testing --- ---echo --- Do Cleanup -- - -DROP TABLE IF EXISTS t1; - -######################################################## - ---echo --- Start test 4 partition HASH testing --- ---echo --- Do setup --- -################################################# - - -CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63), - bc CHAR(63), d DECIMAL(10,4) DEFAULT 0, - f FLOAT DEFAULT 0, total BIGINT UNSIGNED, - y YEAR, t DATE) - TABLESPACE ts1 STORAGE DISK - ENGINE=NDB - PARTITION BY HASH( YEAR(t) ) - PARTITIONS 4; - ---echo --- show that tables have been created correctly --- - -SHOW CREATE TABLE t1; -sync_slave_with_master; -SHOW CREATE TABLE t1; - ---echo --- Perform basic operation on master --- ---echo --- and ensure replicated correctly --- - ---source include/rpl_multi_engine3.inc - ---echo --- Check that simple Alter statements are replicated correctly --- - -ALTER TABLE t1 MODIFY vc VARCHAR(255); - ---echo --- Show the new improved table on the master --- - -SHOW CREATE TABLE t1; - ---echo --- Make sure that our tables on slave are still same engine --- ---echo --- and that the alter statements replicated correctly --- - -sync_slave_with_master; -SHOW CREATE TABLE t1; - ---echo --- Perform basic operation on master --- ---echo --- and ensure replicated correctly --- - ---source include/rpl_multi_engine3.inc - ---echo --- End test 4 partition HASH testing --- ---echo --- Do Cleanup -- - -DROP TABLE IF EXISTS t1; - -######################################################## - ---echo --- Start test 5 partition by key testing --- ---echo --- Create Table Section --- - -################################################# - -CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(63), - bc CHAR(63), d DECIMAL(10,4) DEFAULT 0, - f FLOAT DEFAULT 0, total BIGINT UNSIGNED, - y YEAR, t DATE,PRIMARY KEY(id)) - TABLESPACE ts1 STORAGE DISK - ENGINE=NDB - PARTITION BY KEY() - PARTITIONS 4; - ---echo --- Show that tables on master are ndbcluster tables --- - -SHOW CREATE TABLE t1; - ---echo --- Show that tables on slave --- - -sync_slave_with_master; -SHOW CREATE TABLE t1; - ---echo --- Perform basic operation on master --- ---echo --- and ensure replicated correctly --- - ---source include/rpl_multi_engine3.inc - -# Okay lets see how it holds up to table changes ---echo --- Check that simple Alter statements are replicated correctly --- - -ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total); - ---echo --- Show the new improved table on the master --- - -SHOW CREATE TABLE t1; - ---echo --- Make sure that our tables on slave are still right type --- ---echo --- and that the alter statements replicated correctly --- - -sync_slave_with_master; -SHOW CREATE TABLE t1; - ---echo --- Perform basic operation on master --- ---echo --- and ensure replicated correctly --- - ---source include/rpl_multi_engine3.inc - ---echo --- Check that simple Alter statements are replicated correctly --- - -ALTER TABLE t1 MODIFY vc VARCHAR(255); - ---echo --- Show the new improved table on the master --- - -SHOW CREATE TABLE t1; - ---echo --- Make sure that our tables on slave are still same engine --- ---echo --- and that the alter statements replicated correctly --- - -sync_slave_with_master; -SHOW CREATE TABLE t1; - ---echo --- Perform basic operation on master --- ---echo --- and ensure replicated correctly --- - ---source include/rpl_multi_engine3.inc - ---echo --- End test 5 key partition testing --- ---echo --- Do Cleanup --- - -DROP TABLE IF EXISTS t1; -alter tablespace ts1 -drop datafile 'datafile.dat' -engine=ndb; -alter tablespace ts1 -drop datafile 'datafile02.dat' -engine=ndb; -DROP TABLESPACE ts1 ENGINE=NDB; -DROP LOGFILE GROUP lg1 ENGINE=NDB; ---sync_slave_with_master - -# End of 5.1 test case