diff options
author | unknown <tomas@poseidon.ndb.mysql.com> | 2006-06-27 22:27:25 +0200 |
---|---|---|
committer | unknown <tomas@poseidon.ndb.mysql.com> | 2006-06-27 22:27:25 +0200 |
commit | 85a6c26cc0826a074df1a5536a0de78f77031f24 (patch) | |
tree | 583b551a4138ce64c4edbd8dbda1a7a100b1efbd /mysql-test/r/ndb_partition_key.result | |
parent | 62722a4dd4fa76e17ea686e696eca139e5709032 (diff) | |
parent | ea7f1a6192253c6b956a1a1865d040ec04fc6554 (diff) | |
download | mariadb-git-85a6c26cc0826a074df1a5536a0de78f77031f24.tar.gz |
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1
into poseidon.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
Auto merged
Diffstat (limited to 'mysql-test/r/ndb_partition_key.result')
-rw-r--r-- | mysql-test/r/ndb_partition_key.result | 199 |
1 files changed, 199 insertions, 0 deletions
diff --git a/mysql-test/r/ndb_partition_key.result b/mysql-test/r/ndb_partition_key.result new file mode 100644 index 00000000000..b936469ac14 --- /dev/null +++ b/mysql-test/r/ndb_partition_key.result @@ -0,0 +1,199 @@ +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 need to include all fields in the partition 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 +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 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 +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 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 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 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 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 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); +ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL +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 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; |