Commit 0e58db74 authored by unknown's avatar unknown

Merge pnousiainen@bk-internal.mysql.com:/home/bk/mysql-5.1-new

into  mysql.com:/space/pekka/ndb/version/my51

parents 13a81d45 f19241d5
...@@ -4,7 +4,9 @@ DROP TABLE IF EXISTS test.t3; ...@@ -4,7 +4,9 @@ DROP TABLE IF EXISTS test.t3;
DROP TABLE IF EXISTS test.t4; DROP TABLE IF EXISTS test.t4;
DROP TABLE IF EXISTS test.t5; DROP TABLE IF EXISTS test.t5;
DROP TABLE IF EXISTS test.t6; DROP TABLE IF EXISTS test.t6;
**** Test 1 Simple DD backup and restore **** CREATE LOGFILE GROUP log_group1 ADD UNDOFILE './log_group1/undofile.dat' **** Test 1 Simple DD backup and restore ****
CREATE LOGFILE GROUP log_group1
ADD UNDOFILE './log_group1/undofile.dat'
INITIAL_SIZE 16M INITIAL_SIZE 16M
UNDO_BUFFER_SIZE = 1M UNDO_BUFFER_SIZE = 1M
ENGINE=NDB; ENGINE=NDB;
...@@ -14,7 +16,8 @@ USE LOGFILE GROUP log_group1 ...@@ -14,7 +16,8 @@ USE LOGFILE GROUP log_group1
INITIAL_SIZE 12M INITIAL_SIZE 12M
ENGINE NDB; ENGINE NDB;
CREATE TABLE test.t1 CREATE TABLE test.t1
(pk1 MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 TEXT NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL) TABLESPACE table_space1 STORAGE DISK ENGINE=NDB; SELECT COUNT(*) FROM test.t1; (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 CHAR(50) NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL) TABLESPACE table_space1 STORAGE DISK ENGINE=NDB;
SELECT COUNT(*) FROM test.t1;
COUNT(*) COUNT(*)
500 500
SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY pk1 LIMIT 5; SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY pk1 LIMIT 5;
...@@ -24,8 +27,16 @@ pk1 c2 c3 hex(c4) ...@@ -24,8 +27,16 @@ pk1 c2 c3 hex(c4)
3 Sweden 498 1 3 Sweden 498 1
4 Sweden 497 1 4 Sweden 497 1
5 Sweden 496 1 5 Sweden 496 1
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
DELETE FROM test.backup_info;
LOAD DATA INFILE '../../var/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
SELECT @the_backup_id:=backup_id FROM test.backup_info;
@the_backup_id:=backup_id
<the_backup_id>
DROP TABLE test.backup_info;
DROP TABLE test.t1; DROP TABLE test.t1;
CREATE TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP; DELETE FROM test.backup_info; LOAD DATA INFILE '../../var/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ','; SELECT @the_backup_id:=backup_id FROM test.backup_info; @the_backup_id:=backup_id <the_backup_id> DROP TABLE test.backup_info; ALTER TABLESPACE table_space1 DROP DATAFILE './table_space1/datafile.dat' ALTER TABLESPACE table_space1
DROP DATAFILE './table_space1/datafile.dat'
ENGINE = NDB; ENGINE = NDB;
DROP TABLESPACE table_space1 DROP TABLESPACE table_space1
ENGINE = NDB; ENGINE = NDB;
...@@ -41,8 +52,12 @@ pk1 c2 c3 hex(c4) ...@@ -41,8 +52,12 @@ pk1 c2 c3 hex(c4)
3 Sweden 498 1 3 Sweden 498 1
4 Sweden 497 1 4 Sweden 497 1
5 Sweden 496 1 5 Sweden 496 1
**** Test 2 Mixed Cluster Test backup and restore **** CREATE TABLE test.t2 **** Test 2 Mixed Cluster Test backup and restore ****
(pk1 MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 TEXT NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL)ENGINE=NDB; CREATE TABLE test.t3 (c1 int not null auto_increment, data LONGBLOB, PRIMARY KEY(c1))TABLESPACE table_space1 STORAGE DISK ENGINE=NDB; CREATE TABLE test.t4 (c1 int not null auto_increment, data LONGBLOB, PRIMARY KEY(c1))ENGINE=NDB; SELECT COUNT(*) FROM test.t1; CREATE TABLE test.t2
(pk1 MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 VARCHAR(200) NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL)ENGINE=NDB;
CREATE TABLE test.t3 (c1 int not null auto_increment, data LONGBLOB, PRIMARY KEY(c1))TABLESPACE table_space1 STORAGE DISK ENGINE=NDB;
CREATE TABLE test.t4 (c1 int not null auto_increment, data LONGBLOB, PRIMARY KEY(c1))ENGINE=NDB;
SELECT COUNT(*) FROM test.t1;
COUNT(*) COUNT(*)
500 500
SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY pk1 LIMIT 5; SELECT pk1, c2, c3, hex(c4) FROM test.t1 ORDER BY pk1 LIMIT 5;
...@@ -80,7 +95,19 @@ LENGTH(data) ...@@ -80,7 +95,19 @@ LENGTH(data)
SELECT LENGTH(data) FROM test.t4 WHERE c1 = 2; SELECT LENGTH(data) FROM test.t4 WHERE c1 = 2;
LENGTH(data) LENGTH(data)
16384 16384
CREATE TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP; DELETE FROM test.backup_info; LOAD DATA INFILE '../../var/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ','; SELECT @the_backup_id:=backup_id FROM test.backup_info; @the_backup_id:=backup_id <the_backup_id> DROP TABLE test.backup_info; DROP TABLE test.t1; DROP TABLE test.t2; DROP TABLE test.t3; DROP TABLE test.t4; ALTER TABLESPACE table_space1 DROP DATAFILE './table_space1/datafile.dat' CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
DELETE FROM test.backup_info;
LOAD DATA INFILE '../../var/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
SELECT @the_backup_id:=backup_id FROM test.backup_info;
@the_backup_id:=backup_id
<the_backup_id>
DROP TABLE test.backup_info;
DROP TABLE test.t1;
DROP TABLE test.t2;
DROP TABLE test.t3;
DROP TABLE test.t4;
ALTER TABLESPACE table_space1
DROP DATAFILE './table_space1/datafile.dat'
ENGINE = NDB; ENGINE = NDB;
DROP TABLESPACE table_space1 DROP TABLESPACE table_space1
ENGINE = NDB; ENGINE = NDB;
...@@ -128,59 +155,73 @@ DROP TABLE test.t1; ...@@ -128,59 +155,73 @@ DROP TABLE test.t1;
DROP TABLE test.t2; DROP TABLE test.t2;
DROP TABLE test.t3; DROP TABLE test.t3;
DROP TABLE test.t4; DROP TABLE test.t4;
**** Test 3 Adding partition Test backup and restore **** CREATE TABLESPACE table_space2 ADD DATAFILE './table_space2/datafile.dat' **** Test 3 Adding partition Test backup and restore ****
CREATE TABLESPACE table_space2
ADD DATAFILE './table_space2/datafile.dat'
USE LOGFILE GROUP log_group1 USE LOGFILE GROUP log_group1
INITIAL_SIZE 12M INITIAL_SIZE 12M
ENGINE NDB; ENGINE NDB;
CREATE TABLE test.t1 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 TEXT NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))TABLESPACE table_space1 STORAGE DISK ENGINE=NDB PARTITION BY HASH(c3) PARTITIONS 4; CREATE TABLE test.t4 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 TEXT NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))ENGINE=NDB PARTITION BY HASH(c3) PARTITIONS 2; CREATE TABLE test.t2 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 TEXT NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))TABLESPACE table_space2 STORAGE DISK ENGINE=NDB PARTITION BY KEY(c3) (PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB); CREATE TABLE test.t5 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 TEXT NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))ENGINE=NDB PARTITION BY KEY(pk1) (PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB); CREATE TABLE test.t3 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 TEXT NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))TABLESPACE table_space2 STORAGE DISK ENGINE=NDB PARTITION BY RANGE (c3) PARTITIONS 3 (PARTITION x1 VALUES LESS THAN (105), PARTITION x2 VALUES LESS THAN (333), PARTITION x3 VALUES LESS THAN (720)); CREATE TABLE test.t6 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 TEXT NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))ENGINE=NDB PARTITION BY RANGE (pk1) PARTITIONS 2 (PARTITION x1 VALUES LESS THAN (333), PARTITION x2 VALUES LESS THAN (720)); SHOW CREATE TABLE test.t1; CREATE TABLE test.t1 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 VARCHAR(150) NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))TABLESPACE table_space1 STORAGE DISK ENGINE=NDB PARTITION BY HASH(c3) PARTITIONS 4;
CREATE TABLE test.t4 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 VARCHAR(180) NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))ENGINE=NDB PARTITION BY HASH(c3) PARTITIONS 2;
CREATE TABLE test.t2 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 TEXT NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))TABLESPACE table_space2 STORAGE DISK ENGINE=NDB PARTITION BY KEY(c3) (PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB);
CREATE TABLE test.t5 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 TEXT NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))ENGINE=NDB PARTITION BY KEY(pk1) (PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB);
CREATE TABLE test.t3 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 VARCHAR(202) NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))TABLESPACE table_space2 STORAGE DISK ENGINE=NDB PARTITION BY RANGE (c3) PARTITIONS 3 (PARTITION x1 VALUES LESS THAN (105), PARTITION x2 VALUES LESS THAN (333), PARTITION x3 VALUES LESS THAN (720));
CREATE TABLE test.t6 (pk1 MEDIUMINT NOT NULL AUTO_INCREMENT, c2 VARCHAR(220) NOT NULL, c3 INT NOT NULL, c4 BIT NOT NULL, PRIMARY KEY(pk1,c3))ENGINE=NDB PARTITION BY RANGE (pk1) PARTITIONS 2 (PARTITION x1 VALUES LESS THAN (333), PARTITION x2 VALUES LESS THAN (720));
SHOW CREATE TABLE test.t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`pk1` mediumint(9) NOT NULL auto_increment, `pk1` mediumint(9) NOT NULL auto_increment,
`c2` text NOT NULL, `c2` varchar(150) NOT NULL,
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (c3) PARTITIONS 4 SHOW CREATE TABLE test.t2; ) TABLESPACE table_space1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (c3) PARTITIONS 4
SHOW CREATE TABLE test.t2;
Table Create Table Table Create Table
t2 CREATE TABLE `t2` ( t2 CREATE TABLE `t2` (
`pk1` mediumint(9) NOT NULL auto_increment, `pk1` mediumint(9) NOT NULL auto_increment,
`c2` text NOT NULL, `c2` text NOT NULL,
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) SHOW CREATE TABLE test.t3; ) TABLESPACE table_space2 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster)
SHOW CREATE TABLE test.t3;
Table Create Table Table Create Table
t3 CREATE TABLE `t3` ( t3 CREATE TABLE `t3` (
`pk1` mediumint(9) NOT NULL auto_increment, `pk1` mediumint(9) NOT NULL auto_increment,
`c2` text NOT NULL, `c2` varchar(202) NOT NULL,
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) SHOW CREATE TABLE test.t4; ) TABLESPACE table_space2 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster)
SHOW CREATE TABLE test.t4;
Table Create Table Table Create Table
t4 CREATE TABLE `t4` ( t4 CREATE TABLE `t4` (
`pk1` mediumint(9) NOT NULL auto_increment, `pk1` mediumint(9) NOT NULL auto_increment,
`c2` text NOT NULL, `c2` varchar(180) NOT NULL,
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (c3) PARTITIONS 2 SHOW CREATE TABLE test.t5; ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (c3) PARTITIONS 2
SHOW CREATE TABLE test.t5;
Table Create Table Table Create Table
t5 CREATE TABLE `t5` ( t5 CREATE TABLE `t5` (
`pk1` mediumint(9) NOT NULL auto_increment, `pk1` mediumint(9) NOT NULL auto_increment,
`c2` text NOT NULL, `c2` text NOT NULL,
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY (pk1) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) SHOW CREATE TABLE test.t6; ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY (pk1) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster)
SHOW CREATE TABLE test.t6;
Table Create Table Table Create Table
t6 CREATE TABLE `t6` ( t6 CREATE TABLE `t6` (
`pk1` mediumint(9) NOT NULL auto_increment, `pk1` mediumint(9) NOT NULL auto_increment,
`c2` text NOT NULL, `c2` varchar(220) NOT NULL,
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (pk1) (PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) SELECT * FROM information_schema.partitions WHERE table_name= 't1'; ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (pk1) (PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster)
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 TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
NULL test t1 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default NULL test t1 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default
NULL test t1 p1 NULL 2 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default NULL test t1 p1 NULL 2 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default
...@@ -267,7 +308,21 @@ pk1 c2 c3 hex(c4) ...@@ -267,7 +308,21 @@ pk1 c2 c3 hex(c4)
248 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 4 1 248 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 4 1
247 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 6 1 247 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 6 1
246 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 8 1 246 TEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXASTEXAS, ITALY, Kyle, JO, JBM,TU 8 1
CREATE TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP; DELETE FROM test.backup_info; LOAD DATA INFILE '../../var/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ','; SELECT @the_backup_id:=backup_id FROM test.backup_info; @the_backup_id:=backup_id <the_backup_id> DROP TABLE test.backup_info; DROP TABLE test.t1; DROP TABLE test.t2; DROP TABLE test.t3; DROP TABLE test.t4; DROP TABLE test.t5; DROP TABLE test.t6; ALTER TABLESPACE table_space1 DROP DATAFILE './table_space1/datafile.dat' CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
DELETE FROM test.backup_info;
LOAD DATA INFILE '../../var/tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
SELECT @the_backup_id:=backup_id FROM test.backup_info;
@the_backup_id:=backup_id
<the_backup_id>
DROP TABLE test.backup_info;
DROP TABLE test.t1;
DROP TABLE test.t2;
DROP TABLE test.t3;
DROP TABLE test.t4;
DROP TABLE test.t5;
DROP TABLE test.t6;
ALTER TABLESPACE table_space1
DROP DATAFILE './table_space1/datafile.dat'
ENGINE = NDB; ENGINE = NDB;
ALTER TABLESPACE table_space2 ALTER TABLESPACE table_space2
DROP DATAFILE './table_space2/datafile.dat' DROP DATAFILE './table_space2/datafile.dat'
...@@ -282,51 +337,57 @@ SHOW CREATE TABLE test.t1; ...@@ -282,51 +337,57 @@ SHOW CREATE TABLE test.t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`pk1` mediumint(9) NOT NULL auto_increment, `pk1` mediumint(9) NOT NULL auto_increment,
`c2` text NOT NULL, `c2` varchar(150) NOT NULL,
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (c3) PARTITIONS 4 SHOW CREATE TABLE test.t2; ) TABLESPACE table_space1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (c3) PARTITIONS 4
SHOW CREATE TABLE test.t2;
Table Create Table Table Create Table
t2 CREATE TABLE `t2` ( t2 CREATE TABLE `t2` (
`pk1` mediumint(9) NOT NULL auto_increment, `pk1` mediumint(9) NOT NULL auto_increment,
`c2` text NOT NULL, `c2` text NOT NULL,
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) SHOW CREATE TABLE test.t3; ) TABLESPACE table_space2 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster)
SHOW CREATE TABLE test.t3;
Table Create Table Table Create Table
t3 CREATE TABLE `t3` ( t3 CREATE TABLE `t3` (
`pk1` mediumint(9) NOT NULL auto_increment, `pk1` mediumint(9) NOT NULL auto_increment,
`c2` text NOT NULL, `c2` varchar(202) NOT NULL,
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) SHOW CREATE TABLE test.t4; ) TABLESPACE table_space2 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster)
SHOW CREATE TABLE test.t4;
Table Create Table Table Create Table
t4 CREATE TABLE `t4` ( t4 CREATE TABLE `t4` (
`pk1` mediumint(9) NOT NULL auto_increment, `pk1` mediumint(9) NOT NULL auto_increment,
`c2` text NOT NULL, `c2` varchar(180) NOT NULL,
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (c3) PARTITIONS 2 SHOW CREATE TABLE test.t5; ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY HASH (c3) PARTITIONS 2
SHOW CREATE TABLE test.t5;
Table Create Table Table Create Table
t5 CREATE TABLE `t5` ( t5 CREATE TABLE `t5` (
`pk1` mediumint(9) NOT NULL auto_increment, `pk1` mediumint(9) NOT NULL auto_increment,
`c2` text NOT NULL, `c2` text NOT NULL,
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY (pk1) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) SHOW CREATE TABLE test.t6; ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY (pk1) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster)
SHOW CREATE TABLE test.t6;
Table Create Table Table Create Table
t6 CREATE TABLE `t6` ( t6 CREATE TABLE `t6` (
`pk1` mediumint(9) NOT NULL auto_increment, `pk1` mediumint(9) NOT NULL auto_increment,
`c2` text NOT NULL, `c2` varchar(220) NOT NULL,
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (pk1) (PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) SELECT * FROM information_schema.partitions WHERE table_name= 't1'; ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY RANGE (pk1) (PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster)
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 TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
NULL test t1 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default NULL test t1 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default
NULL test t1 p1 NULL 2 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default NULL test t1 p1 NULL 2 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default 0 default
...@@ -419,5 +480,8 @@ DROP TABLE test.t3; ...@@ -419,5 +480,8 @@ DROP TABLE test.t3;
DROP TABLE test.t4; DROP TABLE test.t4;
DROP TABLE test.t5; DROP TABLE test.t5;
DROP TABLE test.t6; DROP TABLE test.t6;
ALTER TABLESPACE table_space1 DROP DATAFILE './table_space1/datafile.dat' ENGINE=NDB; ALTER TABLESPACE table_space2 DROP DATAFILE './table_space2/datafile.dat' ENGINE=NDB; DROP TABLESPACE table_space1 ENGINE = NDB; DROP TABLESPACE table_space2 ENGINE = NDB; DROP LOGFILE GROUP log_group1 ENGINE = NDB; ALTER TABLESPACE table_space1 DROP DATAFILE './table_space1/datafile.dat' ENGINE=NDB;
ALTER TABLESPACE table_space2 DROP DATAFILE './table_space2/datafile.dat' ENGINE=NDB;
DROP TABLESPACE table_space1 ENGINE = NDB;
DROP TABLESPACE table_space2 ENGINE = NDB;
DROP LOGFILE GROUP log_group1 ENGINE = NDB;
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