Commit 01b7596c authored by Mattias Jonsson's avatar Mattias Jonsson

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.

mysql-test/suite/parts/inc/part_supported_sql_funcs_delete.inc:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added variable for NDB (since it does not support
  DROP PARTITION)
mysql-test/suite/parts/inc/partition_alter_11.inc:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Assigning directly to variable without going
  through the server.
mysql-test/suite/parts/inc/partition_bigint.inc:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added --sorted_result for consistency
  lowered number of partitions for use with NDB
  (NDB can only do maximum of 8 partitions)
mysql-test/suite/parts/inc/partition_int.inc:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added --sorted_result for consistency
  lowered number of partitions for use with NDB
  (NDB can only do maximum of 8 partitions)
mysql-test/suite/parts/inc/partition_mediumint.inc:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added --sorted_result for consistency
  lowered number of partitions for use with NDB
  (NDB can only do maximum of 8 partitions)
mysql-test/suite/parts/inc/partition_smallint.inc:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added --sorted_result for consistency
  lowered number of partitions for use with NDB
  (NDB can only do maximum of 8 partitions)
mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Made it work better with NDB
mysql-test/suite/parts/inc/partition_tinyint.inc:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added --sorted_result for consistency
  lowered number of partitions for use with NDB
  (NDB can only do maximum of 8 partitions)
mysql-test/suite/parts/r/ndb_blob_partition.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Removing this duplicate test since it already
  exists (and updated) in suite/ndb
mysql-test/suite/parts/r/ndb_dd_backuprestore.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Updated result file
mysql-test/suite/parts/r/ndb_partition_error.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Removing this duplicate test since it already
  exists (and updated) in suite/ndb
mysql-test/suite/parts/r/ndb_partition_key.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Removing this duplicate test since it already
  exists (and updated) in suite/ndb
mysql-test/suite/parts/r/ndb_partition_list.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Removing this duplicate test since it already
  exists (and updated) in suite/ndb
mysql-test/suite/parts/r/ndb_partition_range.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Removing this duplicate test since it already
  exists (and updated) in suite/ndb
mysql-test/suite/parts/r/part_supported_sql_func_ndb.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Updated result file
mysql-test/suite/parts/r/partition_alter1_1_innodb.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Updated result file
mysql-test/suite/parts/r/partition_alter1_1_myisam.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Updated result file
mysql-test/suite/parts/r/partition_alter1_2_innodb.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Updated result file.
  Diff bigger than necessary, due to bzr diff bug.
mysql-test/suite/parts/r/partition_alter1_2_myisam.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Updated result file
mysql-test/suite/parts/r/partition_alter2_innodb.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Updated result file
mysql-test/suite/parts/r/partition_alter2_myisam.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Updated result file
mysql-test/suite/parts/r/partition_engine_ndb.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Updated result file
mysql-test/suite/parts/r/partition_int_innodb.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Updated result file
mysql-test/suite/parts/r/partition_int_myisam.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Updated result file
mysql-test/suite/parts/r/partition_int_ndb.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Updated result file
mysql-test/suite/parts/r/rpl_ndb_dd_partitions.result:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Removing this duplicate test since it already
  exists (and updated) in suite/rpl_ndb
mysql-test/suite/parts/t/disabled.def:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Removed some duplicate tests, fixed some tests.
  Removed the 'runs too long on PB' test from
  disabled.def and made them to require 'big-test'.
mysql-test/suite/parts/t/ndb_blob_partition.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Removing this duplicate test since it already
  exists (and updated) in suite/ndb
mysql-test/suite/parts/t/ndb_dd_backuprestore.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added new=on for allowing test of
  hash/range and list partitioning.
mysql-test/suite/parts/t/ndb_partition_error.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Removing this duplicate test since it already
  exists (and updated) in suite/ndb
mysql-test/suite/parts/t/ndb_partition_key.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Removing this duplicate test since it already
  exists (and updated) in suite/ndb
mysql-test/suite/parts/t/ndb_partition_list.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Removing this duplicate test since it already
  exists (and updated) in suite/ndb
mysql-test/suite/parts/t/ndb_partition_range.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Removing this duplicate test since it already
  exists (and updated) in suite/ndb
mysql-test/suite/parts/t/part_supported_sql_func_ndb.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added new=on for allowing test of
  hash/range and list partitioning.
  Added ndb restriction variables.
mysql-test/suite/parts/t/partition_alter1_1_2_ndb.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  requiring big-test instead of disable it.
mysql-test/suite/parts/t/partition_alter1_1_ndb.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  requiring big-test instead of disable it.
mysql-test/suite/parts/t/partition_alter1_2_ndb.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  requiring big-test instead of disable it.
mysql-test/suite/parts/t/partition_alter2_ndb.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added new=on for allowing test of
  hash/range and list partitioning.
mysql-test/suite/parts/t/partition_basic_ndb.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added new=on for allowing test of
  hash/range and list partitioning.
mysql-test/suite/parts/t/partition_bit_ndb.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added new=on for allowing test of
  hash/range and list partitioning.
mysql-test/suite/parts/t/partition_engine_ndb.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added new=on for allowing test of
  hash/range and list partitioning.
mysql-test/suite/parts/t/partition_int_ndb.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added new=on for allowing test of
  hash/range and list partitioning.
mysql-test/suite/parts/t/partition_syntax_ndb.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added new=on for allowing test of
  hash/range and list partitioning.
mysql-test/suite/parts/t/partition_value_ndb.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Added new=on for allowing test of
  hash/range and list partitioning.
mysql-test/suite/parts/t/rpl_ndb_dd_partitions.test:
  Bug#36732: many disabled ndb tests in test suite parts
  
  Removing this duplicate test since it already
  exists (and updated) in suite/rpl_ndb
parent 6d4be72b
......@@ -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;
}
......@@ -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
......
......@@ -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;
......@@ -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;
......@@ -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;
......@@ -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;
......@@ -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;
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;
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;
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;
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;
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;
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......@@ -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;
......
......@@ -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;
......@@ -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;
......@@ -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
......
......@@ -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
......
This diff is collapsed.
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
--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;
......@@ -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;
......
-- 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;
This diff is collapsed.
--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;
This diff is collapsed.
......@@ -26,6 +26,7 @@
#------------------------------------------------------------------------------#
# General not engine specific settings and requirements
--source include/big_test.inc
##### Options, for debugging support #####
let $debug= 0;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment