diff options
author | unknown <mronstrom@mysql.com> | 2005-07-18 13:31:02 +0200 |
---|---|---|
committer | unknown <mronstrom@mysql.com> | 2005-07-18 13:31:02 +0200 |
commit | c543c502db4b6b688e37faf439450f22cd6967c0 (patch) | |
tree | 49a4797f25aaf50e6e6c5ab9d193608d969a612e /mysql-test/t/ndb_partition_range.test | |
parent | ebc478cdac2091a8db3d0a45d51796cfec677230 (diff) | |
download | mariadb-git-c543c502db4b6b688e37faf439450f22cd6967c0.tar.gz |
Patch for push of wl1354 Partitioning
Diffstat (limited to 'mysql-test/t/ndb_partition_range.test')
-rw-r--r-- | mysql-test/t/ndb_partition_range.test | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/mysql-test/t/ndb_partition_range.test b/mysql-test/t/ndb_partition_range.test new file mode 100644 index 00000000000..35d2d33a722 --- /dev/null +++ b/mysql-test/t/ndb_partition_range.test @@ -0,0 +1,86 @@ +-- 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); + +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; + +drop table t1; + |