From 68ef8b07cd0b5c3f8979fb9b1ad7f98edb9b83c6 Mon Sep 17 00:00:00 2001 From: "jmiller@mysql.com" <> Date: Wed, 11 Jan 2006 17:06:14 +0100 Subject: [PATCH 1/3] Test clean up and moving over from old clone. --- ..._basic_disk.result => ndb_dd_basic.result} | 258 +++++++-------- mysql-test/r/ndb_dd_ddl.result | 182 +++++++++++ ...{ndb_basic_disk.test => ndb_dd_basic.test} | 300 ++++++++++-------- mysql-test/t/ndb_dd_ddl.test | 257 +++++++++++++++ 4 files changed, 739 insertions(+), 258 deletions(-) rename mysql-test/r/{ndb_basic_disk.result => ndb_dd_basic.result} (67%) create mode 100644 mysql-test/r/ndb_dd_ddl.result rename mysql-test/t/{ndb_basic_disk.test => ndb_dd_basic.test} (61%) create mode 100644 mysql-test/t/ndb_dd_ddl.test diff --git a/mysql-test/r/ndb_basic_disk.result b/mysql-test/r/ndb_dd_basic.result similarity index 67% rename from mysql-test/r/ndb_basic_disk.result rename to mysql-test/r/ndb_dd_basic.result index 2a433ad224c..7edae955ca9 100644 --- a/mysql-test/r/ndb_basic_disk.result +++ b/mysql-test/r/ndb_dd_basic.result @@ -4,26 +4,28 @@ ADD UNDOFILE 'undofile.dat' INITIAL_SIZE 16M UNDO_BUFFER_SIZE = 1M ENGINE=NDB; -alter logfile group lg1 -add undofile 'undofile02.dat' -initial_size 4M engine=ndb; +ALTER LOGFILE GROUP lg1 +ADD UNDOFILE 'undofile02.dat' +INITIAL_SIZE = 4M +ENGINE=NDB; CREATE TABLESPACE ts1 ADD DATAFILE 'datafile.dat' USE LOGFILE GROUP lg1 INITIAL_SIZE 12M ENGINE NDB; -alter tablespace ts1 -add datafile 'datafile02.dat' -initial_size 4M engine=ndb; -CREATE TABLE t1 -(pk1 int not null primary key, b int not null, c int not null) -tablespace ts1 storage disk -engine ndb; -INSERT INTO t1 VALUES (0, 0, 0); -SELECT * FROM t1; +ALTER TABLESPACE ts1 +ADD DATAFILE 'datafile02.dat' +INITIAL_SIZE = 4M +ENGINE=NDB; +CREATE TABLE test.t1 +(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL) +TABLESPACE ts1 STORAGE DISK +ENGINE=NDB; +INSERT INTO test.t1 VALUES (0, 0, 0); +SELECT * FROM test.t1; pk1 b c 0 0 0 -INSERT INTO t1 VALUES +INSERT INTO test.t1 VALUES (1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), (6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10), (11,11,11),(12,12,12),(13,13,13),(14,14,14),(15,15,15), @@ -124,231 +126,231 @@ INSERT INTO t1 VALUES (486,486,486),(487,487,487),(488,488,488),(489,489,489),(490,490,490), (491,491,491),(492,492,492),(493,493,493),(494,494,494),(495,495,495), (496,496,496),(497,497,497),(498,498,498),(499,499,499),(500, 500, 500); -SELECT COUNT(*) FROM t1; +SELECT COUNT(*) FROM test.t1; COUNT(*) 501 CREATE LOGFILE GROUP lg2 ADD UNDOFILE 'x.dat' INITIAL_SIZE 10y -engine = ndb; +ENGINE = NDB; ERROR HY000: A size parameter was incorrectly specified, either number or on the form 10M CREATE LOGFILE GROUP lg2 ADD UNDOFILE 'x.dat' INITIAL_SIZE 10MB -engine=ndb; +ENGINE = NDB; ERROR HY000: A size parameter was incorrectly specified, either number or on the form 10M CREATE LOGFILE GROUP lg2 ADD UNDOFILE 'x.dat' INITIAL_SIZE 10 MB -engine=ndb; +ENGINE = NDB; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'MB -engine=ndb' at line 3 +ENGINE = NDB' at line 3 CREATE LOGFILE GROUP lg2 ADD UNDOFILE 'x.dat' INITIAL_SIZE 10 M -engine=ndb; +ENGINE = NDB; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'M -engine=ndb' at line 3 +ENGINE = NDB' at line 3 CREATE LOGFILE GROUP lg2 ADD UNDOFILE 'x.dat' INITIAL_SIZE 1000000000000K -engine=ndb; +ENGINE = NDB; ERROR HY000: The size number was correct but we don't allow the digit part to be more than 2 billion -DROP TABLE t1; -create table t1 (a int primary key, b char(4) not null, c char(4) not null, key(b)) tablespace ts1 storage disk engine ndb; -insert into t1 values (1,'1','1'), (2,'2','2'), (3,'3','3'); -begin; -update t1 set b = '2' where a = 1; -select b from t1 where a = 1; +DROP TABLE test.t1; +CREATE TABLE test.t1 (a INT PRIMARY KEY, b CHAR(4) NOT NULL, c CHAR(4) NOT NULL, KEY(b)) TABLESPACE ts1 STORAGE DISK ENGINE = NDB; +INSERT INTO test.t1 VALUES (1,'1','1'), (2,'2','2'), (3,'3','3'); +BEGIN; +UPDATE test.t1 SET b = '2' WHERE a = 1; +SELECT b FROM test.t1 WHERE a = 1; b 2 -select * from t1 where a = 1; +SELECT * FROM test.t1 WHERE a = 1; a b c 1 2 1 -update t1 set c = '2' where a = 1; -select b from t1 where a = 1; +UPDATE test.t1 SET c = '2' WHERE a = 1; +SELECT b FROM test.t1 WHERE a = 1; b 2 -select * from t1 where a = 1; +SELECT * FROM test.t1 WHERE a = 1; a b c 1 2 2 -update t1 set b = '3' where a = 1; -select b from t1 where a = 1; +UPDATE test.t1 SET b = '3' WHERE a = 1; +SELECT b FROM test.t1 WHERE a = 1; b 3 -select * from t1 where a = 1; +SELECT * FROM test.t1 WHERE a = 1; a b c 1 3 2 -commit; -select * from t1 order by 1; +COMMIT; +SELECT * FROM test.t1 ORDER BY 1; a b c 1 3 2 2 2 2 3 3 3 -begin; -update t1 set c = '3' where a = 1; -select b from t1 where a = 1; +BEGIN; +UPDATE test.t1 SET c = '3' WHERE a = 1; +SELECT b FROM test.t1 WHERE a = 1; b 3 -select * from t1 where a = 1; +SELECT * FROM test.t1 WHERE a = 1; a b c 1 3 3 -update t1 set b = '4' where a = 1; -select b from t1 where a = 1; +UPDATE test.t1 SET b = '4' WHERE a = 1; +SELECT b FROM test.t1 WHERE a = 1; b 4 -select * from t1 where a = 1; +SELECT * FROM test.t1 WHERE a = 1; a b c 1 4 3 -update t1 set c = '4' where a = 1; -select b from t1 where a = 1; +UPDATE test.t1 SET c = '4' WHERE a = 1; +SELECT b FROM test.t1 WHERE a = 1; b 4 -select * from t1 where a = 1; +SELECT * FROM test.t1 WHERE a = 1; a b c 1 4 4 -commit; -select * from t1 order by 1; +COMMIT; +SELECT * FROM test.t1 ORDER BY 1; a b c 1 4 4 2 2 2 3 3 3 -update t1 set b = '5' where a = 1; -select * from t1 order by 1; +UPDATE test.t1 SET b = '5' WHERE a = 1; +SELECT * FROM test.t1 ORDER BY 1; a b c 1 5 4 2 2 2 3 3 3 -update t1 set b = '6' where b = '5'; -select * from t1 order by 1; +UPDATE test.t1 SET b = '6' WHERE b = '5'; +SELECT * FROM test.t1 ORDER BY 1; a b c 1 6 4 2 2 2 3 3 3 -update t1 set b = '7' where c = '4'; -select * from t1 order by 1; +UPDATE test.t1 SET b = '7'WHERE c = '4'; +SELECT * FROM test.t1 ORDER BY 1; a b c 1 7 4 2 2 2 3 3 3 -update t1 set c = '5' where a = 1; -select * from t1 order by 1; +UPDATE test.t1 SET c = '5' WHERE a = 1; +SELECT * FROM test.t1 ORDER BY 1; a b c 1 7 5 2 2 2 3 3 3 -update t1 set c = '6' where b = '7'; -select * from t1 order by 1; +UPDATE test.t1 SET c = '6' WHERE b = '7'; +SELECT * FROM test.t1 ORDER BY 1; a b c 1 7 6 2 2 2 3 3 3 -update t1 set c = '7' where c = '6'; -select * from t1 order by 1; +UPDATE test.t1 SET c = '7' WHERE c = '6'; +SELECT * FROM test.t1 ORDER BY 1; a b c 1 7 7 2 2 2 3 3 3 -drop table t1; -create table t1 (a int primary key, b varchar(4) not null, c char(4) not null, key(b)) tablespace ts1 storage disk engine ndb; -insert into t1 values (1,'1','1'), (2,'2','2'), (3,'3','3'); -begin; -update t1 set b = '2' where a = 1; -select b from t1 where a = 1; +DROP TABLE test.t1; +CREATE TABLE test.t1 (a INT PRIMARY KEY, b VARCHAR(4) NOT NULL, c CHAR(4) NOT NULL, KEY(b)) TABLESPACE ts1 STORAGE DISK ENGINE NDB; +INSERT INTO test.t1 VALUE (1,'1','1'), (2,'2','2'), (3,'3','3'); +BEGIN; +UPDATE test.t1 SET b = '2' WHERE a = 1; +SELECT b FROM test.t1 WHERE a = 1; b 2 -select * from t1 where a = 1; +SELECT * FROM test.t1 WHERE a = 1; a b c 1 2 1 -update t1 set c = '2' where a = 1; -select b from t1 where a = 1; +UPDATE test.t1 SET c = '2' WHERE a = 1; +SELECT b FROM test.t1 WHERE a = 1; b 2 -select * from t1 where a = 1; +SELECT * FROM test.t1 WHERE a = 1; a b c 1 2 2 -update t1 set b = '3' where a = 1; -select b from t1 where a = 1; +UPDATE test.t1 SET b = '3' WHERE a = 1; +SELECT b FROM test.t1 WHERE a = 1; b 3 -select * from t1 where a = 1; +SELECT * FROM test.t1 WHERE a = 1; a b c 1 3 2 -commit; -select * from t1 order by 1; +COMMIT; +SELECT * FROM test.t1 ORDER BY 1; a b c 1 3 2 2 2 2 3 3 3 -begin; -update t1 set c = '3' where a = 1; -select b from t1 where a = 1; +BEGIN; +UPDATE test.t1 SET c = '3' WHERE a = 1; +SELECT b FROM test.t1 WHERE a = 1; b 3 -select * from t1 where a = 1; +SELECT * FROM test.t1 WHERE a = 1; a b c 1 3 3 -update t1 set b = '4' where a = 1; -select b from t1 where a = 1; +UPDATE test.t1 SET b = '4' WHERE a = 1; +SELECT b FROM test.t1 WHERE a = 1; b 4 -select * from t1 where a = 1; +SELECT * FROM test.t1 WHERE a = 1; a b c 1 4 3 -update t1 set c = '4' where a = 1; -select b from t1 where a = 1; +UPDATE test.t1 SET c = '4' WHERE a = 1; +SELECT b FROM test.t1 WHERE a = 1; b 4 -select * from t1 where a = 1; +SELECT * FROM test.t1 WHERE a = 1; a b c 1 4 4 -commit; -select * from t1 order by 1; +COMMIT; +SELECT * FROM test.t1 ORDER BY 1; a b c 1 4 4 2 2 2 3 3 3 -update t1 set b = '5' where a = 1; -select * from t1 order by 1; +UPDATE test.t1 SET b = '5' WHERE a = 1; +SELECT * FROM test.t1 ORDER BY 1; a b c 1 5 4 2 2 2 3 3 3 -update t1 set b = '6' where b = '5'; -select * from t1 order by 1; +UPDATE test.t1 SET b = '6' WHERE b = '5'; +SELECT * FROM test.t1 ORDER BY 1; a b c 1 6 4 2 2 2 3 3 3 -update t1 set b = '7' where c = '4'; -select * from t1 order by 1; +UPDATE test.t1 SET b = '7' WHERE c = '4'; +SELECT * FROM test.t1 ORDER BY 1; a b c 1 7 4 2 2 2 3 3 3 -update t1 set c = '5' where a = 1; -select * from t1 order by 1; +UPDATE test.t1 SET c = '5' WHERE a = 1; +SELECT * FROM test.t1 ORDER BY 1; a b c 1 7 5 2 2 2 3 3 3 -update t1 set c = '6' where b = '7'; -select * from t1 order by 1; +UPDATE test.t1 SET c = '6' WHERE b = '7'; +SELECT * FROM test.t1 ORDER BY 1; a b c 1 7 6 2 2 2 3 3 3 -update t1 set c = '7' where c = '6'; -select * from t1 order by 1; +UPDATE test.t1 SET c = '7' WHERE c = '6'; +SELECT * FROM test.t1 ORDER BY 1; a b c 1 7 7 2 2 2 3 3 3 -drop table t1; -create table t1 ( -a int not null primary key, -b text not null -) tablespace ts1 storage disk engine=ndbcluster; +DROP TABLE test.t1; +CREATE TABLE test.t1 ( +a INT NOT NULL PRIMARY KEY, +b TEXT NOT NULL +) TABLESPACE ts1 STORAGE DISK ENGINE=NDBCLUSTER; set @x0 = '01234567012345670123456701234567'; set @x0 = concat(@x0,@x0,@x0,@x0,@x0,@x0,@x0,@x0); set @b1 = 'b1'; @@ -361,37 +363,43 @@ set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2); set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2); set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2); set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2); -insert into t1 values(1,@b1); -insert into t1 values(2,@b2); -select a,length(b),substr(b,1+2*900,2) from t1 where a=1; +INSERT INTO test.t1 VALUES(1,@b1); +INSERT INTO test.t1 VALUES(2,@b2); +SELECT a,length(b),substr(b,1+2*900,2) FROM test.t1 WHERE a=1; a length(b) substr(b,1+2*900,2) 1 2256 b1 -select a,length(b),substr(b,1+2*9000,2) from t1 where a=2; +SELECT a,length(b),substr(b,1+2*9000,2) FROM test.t1 WHERE a=2; a length(b) substr(b,1+2*9000,2) 2 20000 b2 -update t1 set b=@b2 where a=1; -update t1 set b=@b1 where a=2; -select a,length(b),substr(b,1+2*9000,2) from t1 where a=1; +UPDATE test.t1 SET b=@b2 WHERE a=1; +UPDATE test.t1 SET b=@b1 WHERE a=2; +SELECT a,length(b),substr(b,1+2*9000,2) FROM test.t1 WHERE a=1; a length(b) substr(b,1+2*9000,2) 1 20000 b2 -select a,length(b),substr(b,1+2*900,2) from t1 where a=2; +SELECT a,length(b),substr(b,1+2*900,2) FROM test.t1 WHERE a=2; a length(b) substr(b,1+2*900,2) 2 2256 b1 -update t1 set b=concat(b,b) where a=1; -update t1 set b=concat(b,b) where a=2; -select a,length(b),substr(b,1+4*9000,2) from t1 where a=1; +UPDATE test.t1 SET b=concat(b,b) WHERE a=1; +UPDATE test.t1 SET b=concat(b,b) WHERE a=2; +SELECT a,length(b),substr(b,1+4*9000,2) FROM test.t1 WHERE a=1; a length(b) substr(b,1+4*9000,2) 1 40000 b2 -select a,length(b),substr(b,1+4*900,2) from t1 where a=2; +SELECT a,length(b),substr(b,1+4*900,2) FROM test.t1 WHERE a=2; a length(b) substr(b,1+4*900,2) 2 4512 b1 -delete from t1 where a=1; -delete from t1 where a=2; -select count(*) from t1; -count(*) +DELETE FROM test.t1 WHERE a=1; +DELETE FROM test.t1 WHERE a=2; +SELECT COUNT(*) FROM test.t1; +COUNT(*) 0 -drop table t1; -alter tablespace ts1 drop datafile 'datafile.dat' engine = ndb; -alter tablespace ts1 drop datafile 'datafile02.dat' engine = ndb; -drop tablespace ts1 engine = ndb; -drop logfile group lg1 engine = ndb; +DROP TABLE test.t1; +ALTER TABLESPACE ts1 +DROP DATAFILE 'datafile.dat' +ENGINE = NDB; +ALTER TABLESPACE ts1 +DROP DATAFILE 'datafile02.dat' +ENGINE = NDB; +DROP TABLESPACE ts1 +ENGINE = NDB; +DROP LOGFILE GROUP lg1 +ENGINE =NDB; diff --git a/mysql-test/r/ndb_dd_ddl.result b/mysql-test/r/ndb_dd_ddl.result new file mode 100644 index 00000000000..8d555b57a88 --- /dev/null +++ b/mysql-test/r/ndb_dd_ddl.result @@ -0,0 +1,182 @@ +DROP TABLE IF EXISTS t1; +**** Begin Duplicate Statement Testing **** +CREATE LOGFILE GROUP lg1 +ADD UNDOFILE 'undofile.dat' +INITIAL_SIZE 16M +UNDO_BUFFER_SIZE = 1M +ENGINE=NDB; +CREATE LOGFILE GROUP lg1 +ADD UNDOFILE 'undofile.dat' +INITIAL_SIZE 16M +UNDO_BUFFER_SIZE = 1M +ENGINE=NDB; +ERROR HY000: Failed to create LOGFILE GROUP +ALTER LOGFILE GROUP lg1 +ADD UNDOFILE 'undofile02.dat' +INITIAL_SIZE 4M ENGINE NDB; +ALTER LOGFILE GROUP lg1 +ADD UNDOFILE 'undofile02.dat' +INITIAL_SIZE 4M ENGINE=NDB; +ERROR HY000: Failed to alter: CREATE UNDOFILE +CREATE TABLESPACE ts1 +ADD DATAFILE 'datafile.dat' +USE LOGFILE GROUP lg1 +INITIAL_SIZE 12M +ENGINE NDB; +CREATE TABLESPACE ts1 +ADD DATAFILE 'datafile.dat' +USE LOGFILE GROUP lg1 +INITIAL_SIZE 12M +ENGINE NDB; +ERROR HY000: Failed to create TABLESPACE +ALTER TABLESPACE ts1 +ADD DATAFILE 'datafile2.dat' +INITIAL_SIZE 12M +ENGINE=NDB; +ALTER TABLESPACE ts1 +ADD DATAFILE 'datafile2.dat' +INITIAL_SIZE 12M +ENGINE=NDB; +ERROR HY000: Failed to alter: CREATE DATAFILE +CREATE TABLE t1 +(pk1 int not null primary key, b int not null, c int not null) +tablespace ts1 storage disk +engine ndb; +CREATE TABLE t1 +(pk1 int not null primary key, b int not null, c int not null) +tablespace ts1 storage disk +engine ndb; +ERROR 42S01: Table 't1' already exists +DROP TABLE t1; +ALTER TABLESPACE ts1 +DROP DATAFILE 'datafile2.dat' +ENGINE=NDB; +ALTER TABLESPACE ts1 +DROP DATAFILE 'datafile2.dat' +ENGINE=NDB; +ERROR HY000: Failed to alter: NO SUCH FILE +ALTER TABLESPACE ts1 +DROP DATAFILE 'datafile.dat' +ENGINE=NDB; +ALTER TABLESPACE ts1 +DROP DATAFILE 'datafile.dat' +ENGINE=NDB; +ERROR HY000: Failed to alter: NO SUCH FILE +DROP TABLESPACE ts1 +ENGINE=NDB; +DROP TABLESPACE ts1 +ENGINE=NDB; +ERROR HY000: Failed to drop TABLESPACE +DROP LOGFILE GROUP lg1 +ENGINE=NDB; +DROP LOGFILE GROUP lg1 +ENGINE=NDB; +ERROR HY000: Failed to drop LOGFILE GROUP +**** End Duplicate Statement Testing **** + +**** Begin Statment CaSe Testing **** +creaTE LOgfilE GrOuP lg1 +adD undoFILE 'undofile.dat' +initiAL_siZE 16M +UnDo_BuFfEr_SiZe = 1M +ENGInE=NDb; +altER LOgFiLE GrOUp lg1 +AdD UnDOfILe 'undofile02.dat' +INItIAl_SIzE 4M ENgINE nDB; +CrEAtE TABLEspaCE ts1 +ADD DATAfilE 'datafile.dat' +UsE LoGFiLE GRoUP lg1 +INITiaL_SizE 12M +ENGiNe NDb; +AlTeR tAbLeSpAcE ts1 +AdD DaTaFiLe 'datafile2.dat' +InItIaL_SiZe 12M +EnGiNe=NDB; +CREATE TABLE t1 +(pk1 int not null primary key, b int not null, c int not null) +TABLEspace ts1 storAGE dISk +ENGine nDb; +DROP TABLE t1; +AlteR TAblespaCE ts1 +droP DATAfile 'datafile2.dat' +ENGINE=NDB; +ALter tablesPACE ts1 +dROp dAtAfIlE 'datafile.dat' +ENGine=Ndb; +DrOp TaBleSpAcE ts1 +engINE=ndB; +DrOp lOgFiLe GrOuP lg1 +EnGiNe=nDb; +**** End Statment CaSe Testing **** + +**** Begin = And No = Testing **** +CREATE LOGFILE GROUP lg1 +ADD UNDOFILE 'undofile.dat' +INITIAL_SIZE=16M +UNDO_BUFFER_SIZE=1M +ENGINE=NDB; +ALTER LOGFILE GROUP lg1 +ADD UNDOFILE 'undofile02.dat' +INITIAL_SIZE=4M +ENGINE=NDB; +CREATE TABLESPACE ts1 +ADD DATAFILE 'datafile.dat' +USE LOGFILE GROUP lg1 +INITIAL_SIZE=12M +ENGINE=NDB; +ALTER TABLESPACE ts1 +ADD DATAFILE 'datafile2.dat' +INITIAL_SIZE=12M +ENGINE=NDB; +CREATE TABLE t1 +(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL) +TABLESPACE ts1 STORAGE DISK +ENGINE=NDB; +DROP TABLE t1; +ALTER TABLESPACE ts1 +DROP DATAFILE 'datafile2.dat' +ENGINE=NDB; +ALTER TABLESPACE ts1 +DROP DATAFILE 'datafile.dat' +ENGINE=NDB; +DROP TABLESPACE ts1 +ENGINE=NDB; +DROP LOGFILE GROUP lg1 +ENGINE=NDB; + +**** End of = **** + +CREATE LOGFILE GROUP lg1 +ADD UNDOFILE 'undofile.dat' +INITIAL_SIZE 16M +UNDO_BUFFER_SIZE 1M +ENGINE NDB; +ALTER LOGFILE GROUP lg1 +ADD UNDOFILE 'undofile02.dat' +INITIAL_SIZE 4M +ENGINE NDB; +CREATE TABLESPACE ts1 +ADD DATAFILE 'datafile.dat' +USE LOGFILE GROUP lg1 +INITIAL_SIZE 12M +ENGINE NDB; +ALTER TABLESPACE ts1 +ADD DATAFILE 'datafile2.dat' +INITIAL_SIZE 12M +ENGINE NDB; +CREATE TABLE t1 +(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL) +TABLESPACE ts1 STORAGE DISK +ENGINE NDB; +DROP TABLE t1; +ALTER TABLESPACE ts1 +DROP DATAFILE 'datafile2.dat' +ENGINE NDB; +ALTER TABLESPACE ts1 +DROP DATAFILE 'datafile.dat' +ENGINE NDB; +DROP TABLESPACE ts1 +ENGINE NDB; +DROP LOGFILE GROUP lg1 +ENGINE NDB; +**** End = And No = **** diff --git a/mysql-test/t/ndb_basic_disk.test b/mysql-test/t/ndb_dd_basic.test similarity index 61% rename from mysql-test/t/ndb_basic_disk.test rename to mysql-test/t/ndb_dd_basic.test index 8d7e988150a..97e84ea78cc 100644 --- a/mysql-test/t/ndb_basic_disk.test +++ b/mysql-test/t/ndb_dd_basic.test @@ -1,16 +1,23 @@ +################################# +# Author: JO +# Org Date: ? +# Purpose: To test basic Cluster Disk Data +################################# +# Change Author: JBM +# Change Date: 2006-01-11 +# Change: Cleanup and test rename +################################# + -- source include/have_ndb.inc --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings -# +################################## # Basic test of disk tables for NDB -# - -# # Start by creating a logfile group -# +################################## CREATE LOGFILE GROUP lg1 ADD UNDOFILE 'undofile.dat' @@ -18,13 +25,14 @@ INITIAL_SIZE 16M UNDO_BUFFER_SIZE = 1M ENGINE=NDB; -alter logfile group lg1 -add undofile 'undofile02.dat' -initial_size 4M engine=ndb; +ALTER LOGFILE GROUP lg1 +ADD UNDOFILE 'undofile02.dat' +INITIAL_SIZE = 4M +ENGINE=NDB; -# +################################################### # Create a tablespace connected to the logfile group -# +################################################### CREATE TABLESPACE ts1 ADD DATAFILE 'datafile.dat' @@ -32,23 +40,24 @@ USE LOGFILE GROUP lg1 INITIAL_SIZE 12M ENGINE NDB; -alter tablespace ts1 -add datafile 'datafile02.dat' -initial_size 4M engine=ndb; +ALTER TABLESPACE ts1 +ADD DATAFILE 'datafile02.dat' +INITIAL_SIZE = 4M +ENGINE=NDB; -# +######################################## # Create a table using this tablespace -# +######################################## -CREATE TABLE t1 -(pk1 int not null primary key, b int not null, c int not null) -tablespace ts1 storage disk -engine ndb; +CREATE TABLE test.t1 +(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL) +TABLESPACE ts1 STORAGE DISK +ENGINE=NDB; -INSERT INTO t1 VALUES (0, 0, 0); -SELECT * FROM t1; +INSERT INTO test.t1 VALUES (0, 0, 0); +SELECT * FROM test.t1; -INSERT INTO t1 VALUES +INSERT INTO test.t1 VALUES (1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), (6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10), (11,11,11),(12,12,12),(13,13,13),(14,14,14),(15,15,15), @@ -150,130 +159,140 @@ INSERT INTO t1 VALUES (491,491,491),(492,492,492),(493,493,493),(494,494,494),(495,495,495), (496,496,496),(497,497,497),(498,498,498),(499,499,499),(500, 500, 500); -SELECT COUNT(*) FROM t1; +SELECT COUNT(*) FROM test.t1; -# +#################################### # Test error cases with size numbers -# +#################################### --error ER_WRONG_SIZE_NUMBER CREATE LOGFILE GROUP lg2 ADD UNDOFILE 'x.dat' INITIAL_SIZE 10y -engine = ndb; +ENGINE = NDB; --error ER_WRONG_SIZE_NUMBER CREATE LOGFILE GROUP lg2 ADD UNDOFILE 'x.dat' INITIAL_SIZE 10MB -engine=ndb; +ENGINE = NDB; --error 1064 CREATE LOGFILE GROUP lg2 ADD UNDOFILE 'x.dat' INITIAL_SIZE 10 MB -engine=ndb; +ENGINE = NDB; --error 1064 CREATE LOGFILE GROUP lg2 ADD UNDOFILE 'x.dat' INITIAL_SIZE 10 M -engine=ndb; +ENGINE = NDB; --error ER_SIZE_OVERFLOW_ERROR CREATE LOGFILE GROUP lg2 ADD UNDOFILE 'x.dat' INITIAL_SIZE 1000000000000K -engine=ndb; +ENGINE = NDB; -DROP TABLE t1; +DROP TABLE test.t1; +############################ # Test update of mm/dd part -create table t1 (a int primary key, b char(4) not null, c char(4) not null, key(b)) tablespace ts1 storage disk engine ndb; -insert into t1 values (1,'1','1'), (2,'2','2'), (3,'3','3'); -begin; -update t1 set b = '2' where a = 1; -select b from t1 where a = 1; -select * from t1 where a = 1; -update t1 set c = '2' where a = 1; -select b from t1 where a = 1; -select * from t1 where a = 1; -update t1 set b = '3' where a = 1; -select b from t1 where a = 1; -select * from t1 where a = 1; -commit; -select * from t1 order by 1; -begin; -update t1 set c = '3' where a = 1; -select b from t1 where a = 1; -select * from t1 where a = 1; -update t1 set b = '4' where a = 1; -select b from t1 where a = 1; -select * from t1 where a = 1; -update t1 set c = '4' where a = 1; -select b from t1 where a = 1; -select * from t1 where a = 1; -commit; -select * from t1 order by 1; -update t1 set b = '5' where a = 1; -select * from t1 order by 1; -update t1 set b = '6' where b = '5'; -select * from t1 order by 1; -update t1 set b = '7' where c = '4'; -select * from t1 order by 1; -update t1 set c = '5' where a = 1; -select * from t1 order by 1; -update t1 set c = '6' where b = '7'; -select * from t1 order by 1; -update t1 set c = '7' where c = '6'; -select * from t1 order by 1; -drop table t1; -create table t1 (a int primary key, b varchar(4) not null, c char(4) not null, key(b)) tablespace ts1 storage disk engine ndb; -insert into t1 values (1,'1','1'), (2,'2','2'), (3,'3','3'); -begin; -update t1 set b = '2' where a = 1; -select b from t1 where a = 1; -select * from t1 where a = 1; -update t1 set c = '2' where a = 1; -select b from t1 where a = 1; -select * from t1 where a = 1; -update t1 set b = '3' where a = 1; -select b from t1 where a = 1; -select * from t1 where a = 1; -commit; -select * from t1 order by 1; -begin; -update t1 set c = '3' where a = 1; -select b from t1 where a = 1; -select * from t1 where a = 1; -update t1 set b = '4' where a = 1; -select b from t1 where a = 1; -select * from t1 where a = 1; -update t1 set c = '4' where a = 1; -select b from t1 where a = 1; -select * from t1 where a = 1; -commit; -select * from t1 order by 1; -update t1 set b = '5' where a = 1; -select * from t1 order by 1; -update t1 set b = '6' where b = '5'; -select * from t1 order by 1; -update t1 set b = '7' where c = '4'; -select * from t1 order by 1; -update t1 set c = '5' where a = 1; -select * from t1 order by 1; -update t1 set c = '6' where b = '7'; -select * from t1 order by 1; -update t1 set c = '7' where c = '6'; -select * from t1 order by 1; -drop table t1; +############################ +CREATE TABLE test.t1 (a INT PRIMARY KEY, b CHAR(4) NOT NULL, c CHAR(4) NOT NULL, KEY(b)) TABLESPACE ts1 STORAGE DISK ENGINE = NDB; +INSERT INTO test.t1 VALUES (1,'1','1'), (2,'2','2'), (3,'3','3'); +BEGIN; +UPDATE test.t1 SET b = '2' WHERE a = 1; +SELECT b FROM test.t1 WHERE a = 1; +SELECT * FROM test.t1 WHERE a = 1; +UPDATE test.t1 SET c = '2' WHERE a = 1; +SELECT b FROM test.t1 WHERE a = 1; +SELECT * FROM test.t1 WHERE a = 1; +UPDATE test.t1 SET b = '3' WHERE a = 1; +SELECT b FROM test.t1 WHERE a = 1; +SELECT * FROM test.t1 WHERE a = 1; +COMMIT; +SELECT * FROM test.t1 ORDER BY 1; +BEGIN; +UPDATE test.t1 SET c = '3' WHERE a = 1; +SELECT b FROM test.t1 WHERE a = 1; +SELECT * FROM test.t1 WHERE a = 1; +UPDATE test.t1 SET b = '4' WHERE a = 1; +SELECT b FROM test.t1 WHERE a = 1; +SELECT * FROM test.t1 WHERE a = 1; +UPDATE test.t1 SET c = '4' WHERE a = 1; +SELECT b FROM test.t1 WHERE a = 1; +SELECT * FROM test.t1 WHERE a = 1; +COMMIT; +SELECT * FROM test.t1 ORDER BY 1; +UPDATE test.t1 SET b = '5' WHERE a = 1; +SELECT * FROM test.t1 ORDER BY 1; +UPDATE test.t1 SET b = '6' WHERE b = '5'; +SELECT * FROM test.t1 ORDER BY 1; +UPDATE test.t1 SET b = '7'WHERE c = '4'; +SELECT * FROM test.t1 ORDER BY 1; +UPDATE test.t1 SET c = '5' WHERE a = 1; +SELECT * FROM test.t1 ORDER BY 1; +UPDATE test.t1 SET c = '6' WHERE b = '7'; +SELECT * FROM test.t1 ORDER BY 1; +UPDATE test.t1 SET c = '7' WHERE c = '6'; +SELECT * FROM test.t1 ORDER BY 1; +DROP TABLE test.t1; + +##### + +CREATE TABLE test.t1 (a INT PRIMARY KEY, b VARCHAR(4) NOT NULL, c CHAR(4) NOT NULL, KEY(b)) TABLESPACE ts1 STORAGE DISK ENGINE NDB; +INSERT INTO test.t1 VALUE (1,'1','1'), (2,'2','2'), (3,'3','3'); +BEGIN; +UPDATE test.t1 SET b = '2' WHERE a = 1; +SELECT b FROM test.t1 WHERE a = 1; +SELECT * FROM test.t1 WHERE a = 1; +UPDATE test.t1 SET c = '2' WHERE a = 1; +SELECT b FROM test.t1 WHERE a = 1; +SELECT * FROM test.t1 WHERE a = 1; +UPDATE test.t1 SET b = '3' WHERE a = 1; +SELECT b FROM test.t1 WHERE a = 1; +SELECT * FROM test.t1 WHERE a = 1; +COMMIT; +SELECT * FROM test.t1 ORDER BY 1; +BEGIN; +UPDATE test.t1 SET c = '3' WHERE a = 1; +SELECT b FROM test.t1 WHERE a = 1; +SELECT * FROM test.t1 WHERE a = 1; +UPDATE test.t1 SET b = '4' WHERE a = 1; +SELECT b FROM test.t1 WHERE a = 1; +SELECT * FROM test.t1 WHERE a = 1; +UPDATE test.t1 SET c = '4' WHERE a = 1; +SELECT b FROM test.t1 WHERE a = 1; +SELECT * FROM test.t1 WHERE a = 1; +COMMIT; +SELECT * FROM test.t1 ORDER BY 1; +UPDATE test.t1 SET b = '5' WHERE a = 1; +SELECT * FROM test.t1 ORDER BY 1; +UPDATE test.t1 SET b = '6' WHERE b = '5'; +SELECT * FROM test.t1 ORDER BY 1; +UPDATE test.t1 SET b = '7' WHERE c = '4'; +SELECT * FROM test.t1 ORDER BY 1; +UPDATE test.t1 SET c = '5' WHERE a = 1; +SELECT * FROM test.t1 ORDER BY 1; +UPDATE test.t1 SET c = '6' WHERE b = '7'; +SELECT * FROM test.t1 ORDER BY 1; +UPDATE test.t1 SET c = '7' WHERE c = '6'; +SELECT * FROM test.t1 ORDER BY 1; +DROP TABLE test.t1; + +######################## # Test for blobs... -create table t1 ( - a int not null primary key, - b text not null -) tablespace ts1 storage disk engine=ndbcluster; +######################## + +CREATE TABLE test.t1 ( + a INT NOT NULL PRIMARY KEY, + b TEXT NOT NULL +) TABLESPACE ts1 STORAGE DISK ENGINE=NDBCLUSTER; # b1 length 2000+256 (blob part aligned) +######################################### set @x0 = '01234567012345670123456701234567'; set @x0 = concat(@x0,@x0,@x0,@x0,@x0,@x0,@x0,@x0); set @b1 = 'b1'; @@ -282,31 +301,46 @@ set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1); set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1); set @b1 = concat(@b1,@x0); # b2 length 20000 +########################################## set @b2 = 'b2'; set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2); set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2); set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2); set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2); -insert into t1 values(1,@b1); -insert into t1 values(2,@b2); -select a,length(b),substr(b,1+2*900,2) from t1 where a=1; -select a,length(b),substr(b,1+2*9000,2) from t1 where a=2; -update t1 set b=@b2 where a=1; -update t1 set b=@b1 where a=2; -select a,length(b),substr(b,1+2*9000,2) from t1 where a=1; -select a,length(b),substr(b,1+2*900,2) from t1 where a=2; -update t1 set b=concat(b,b) where a=1; -update t1 set b=concat(b,b) where a=2; -select a,length(b),substr(b,1+4*9000,2) from t1 where a=1; -select a,length(b),substr(b,1+4*900,2) from t1 where a=2; -delete from t1 where a=1; -delete from t1 where a=2; -select count(*) from t1; -drop table t1; +INSERT INTO test.t1 VALUES(1,@b1); +INSERT INTO test.t1 VALUES(2,@b2); +SELECT a,length(b),substr(b,1+2*900,2) FROM test.t1 WHERE a=1; +SELECT a,length(b),substr(b,1+2*9000,2) FROM test.t1 WHERE a=2; +UPDATE test.t1 SET b=@b2 WHERE a=1; +UPDATE test.t1 SET b=@b1 WHERE a=2; +SELECT a,length(b),substr(b,1+2*9000,2) FROM test.t1 WHERE a=1; +SELECT a,length(b),substr(b,1+2*900,2) FROM test.t1 WHERE a=2; +UPDATE test.t1 SET b=concat(b,b) WHERE a=1; +UPDATE test.t1 SET b=concat(b,b) WHERE a=2; +SELECT a,length(b),substr(b,1+4*9000,2) FROM test.t1 WHERE a=1; +SELECT a,length(b),substr(b,1+4*900,2) FROM test.t1 WHERE a=2; +DELETE FROM test.t1 WHERE a=1; +DELETE FROM test.t1 WHERE a=2; +SELECT COUNT(*) FROM test.t1; +DROP TABLE test.t1; -alter tablespace ts1 drop datafile 'datafile.dat' engine = ndb; -alter tablespace ts1 drop datafile 'datafile02.dat' engine = ndb; -drop tablespace ts1 engine = ndb; +################### +# Test Cleanup +################### -drop logfile group lg1 engine = ndb; +ALTER TABLESPACE ts1 +DROP DATAFILE 'datafile.dat' +ENGINE = NDB; + +ALTER TABLESPACE ts1 +DROP DATAFILE 'datafile02.dat' +ENGINE = NDB; + +DROP TABLESPACE ts1 +ENGINE = NDB; + +DROP LOGFILE GROUP lg1 +ENGINE =NDB; + +#End 5.1 test case diff --git a/mysql-test/t/ndb_dd_ddl.test b/mysql-test/t/ndb_dd_ddl.test new file mode 100644 index 00000000000..af17eb3aeb4 --- /dev/null +++ b/mysql-test/t/ndb_dd_ddl.test @@ -0,0 +1,257 @@ +######################################### +# Author: JBM +# Date: 2006-01-03 +# Purpose: Test the NDB engine reaction to duplicate +# Table spaces and log groups. Also to test +# Statement mixed case. +############################################ +-- source include/have_ndb.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +############## Duplcate Statement Testing ######### + +--echo **** Begin Duplicate Statement Testing **** + +CREATE LOGFILE GROUP lg1 +ADD UNDOFILE 'undofile.dat' +INITIAL_SIZE 16M +UNDO_BUFFER_SIZE = 1M +ENGINE=NDB; + +--error 1502 +CREATE LOGFILE GROUP lg1 +ADD UNDOFILE 'undofile.dat' +INITIAL_SIZE 16M +UNDO_BUFFER_SIZE = 1M +ENGINE=NDB; + +ALTER LOGFILE GROUP lg1 +ADD UNDOFILE 'undofile02.dat' +INITIAL_SIZE 4M ENGINE NDB; + +--error 1507 +ALTER LOGFILE GROUP lg1 +ADD UNDOFILE 'undofile02.dat' +INITIAL_SIZE 4M ENGINE=NDB; + +CREATE TABLESPACE ts1 +ADD DATAFILE 'datafile.dat' +USE LOGFILE GROUP lg1 +INITIAL_SIZE 12M +ENGINE NDB; + +--error 1502 # Bug 16158 +CREATE TABLESPACE ts1 +ADD DATAFILE 'datafile.dat' +USE LOGFILE GROUP lg1 +INITIAL_SIZE 12M +ENGINE NDB; + +# Currently a bug, bug#16158 +ALTER TABLESPACE ts1 +ADD DATAFILE 'datafile2.dat' +INITIAL_SIZE 12M +ENGINE=NDB; + +--error 1507 # Currently a bug, bug#16158 +ALTER TABLESPACE ts1 +ADD DATAFILE 'datafile2.dat' +INITIAL_SIZE 12M +ENGINE=NDB; + +CREATE TABLE t1 +(pk1 int not null primary key, b int not null, c int not null) +tablespace ts1 storage disk +engine ndb; + +--error 1050 +CREATE TABLE t1 +(pk1 int not null primary key, b int not null, c int not null) +tablespace ts1 storage disk +engine ndb; + +DROP TABLE t1; + +ALTER TABLESPACE ts1 +DROP DATAFILE 'datafile2.dat' +ENGINE=NDB; + +--error 1507 +ALTER TABLESPACE ts1 +DROP DATAFILE 'datafile2.dat' +ENGINE=NDB; + +ALTER TABLESPACE ts1 +DROP DATAFILE 'datafile.dat' +ENGINE=NDB; + +--error 1507 +ALTER TABLESPACE ts1 +DROP DATAFILE 'datafile.dat' +ENGINE=NDB; + +DROP TABLESPACE ts1 +ENGINE=NDB; + +--error 1503 +DROP TABLESPACE ts1 +ENGINE=NDB; + +DROP LOGFILE GROUP lg1 +ENGINE=NDB; + +--error 1503 +DROP LOGFILE GROUP lg1 +ENGINE=NDB; +--echo **** End Duplicate Statement Testing **** +############# End Duplicate Statments ############ +--echo +############ Begin CaSe Testing ################## +--echo **** Begin Statment CaSe Testing **** + +creaTE LOgfilE GrOuP lg1 +adD undoFILE 'undofile.dat' +initiAL_siZE 16M +UnDo_BuFfEr_SiZe = 1M +ENGInE=NDb; + +altER LOgFiLE GrOUp lg1 +AdD UnDOfILe 'undofile02.dat' +INItIAl_SIzE 4M ENgINE nDB; + +CrEAtE TABLEspaCE ts1 +ADD DATAfilE 'datafile.dat' +UsE LoGFiLE GRoUP lg1 +INITiaL_SizE 12M +ENGiNe NDb; + +AlTeR tAbLeSpAcE ts1 +AdD DaTaFiLe 'datafile2.dat' +InItIaL_SiZe 12M +EnGiNe=NDB; + +CREATE TABLE t1 +(pk1 int not null primary key, b int not null, c int not null) +TABLEspace ts1 storAGE dISk +ENGine nDb; + +DROP TABLE t1; + +AlteR TAblespaCE ts1 +droP DATAfile 'datafile2.dat' +ENGINE=NDB; + +ALter tablesPACE ts1 +dROp dAtAfIlE 'datafile.dat' +ENGine=Ndb; + +DrOp TaBleSpAcE ts1 +engINE=ndB; + +DrOp lOgFiLe GrOuP lg1 +EnGiNe=nDb; + +--echo **** End Statment CaSe Testing **** +############ End CaSe Testing ################## +--echo +############ Begin = and no = Testing ########## +--echo **** Begin = And No = Testing **** + +CREATE LOGFILE GROUP lg1 +ADD UNDOFILE 'undofile.dat' +INITIAL_SIZE=16M +UNDO_BUFFER_SIZE=1M +ENGINE=NDB; + +ALTER LOGFILE GROUP lg1 +ADD UNDOFILE 'undofile02.dat' +INITIAL_SIZE=4M +ENGINE=NDB; + +CREATE TABLESPACE ts1 +ADD DATAFILE 'datafile.dat' +USE LOGFILE GROUP lg1 +INITIAL_SIZE=12M +ENGINE=NDB; + +ALTER TABLESPACE ts1 +ADD DATAFILE 'datafile2.dat' +INITIAL_SIZE=12M +ENGINE=NDB; + +CREATE TABLE t1 +(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL) +TABLESPACE ts1 STORAGE DISK +ENGINE=NDB; + +DROP TABLE t1; + +ALTER TABLESPACE ts1 +DROP DATAFILE 'datafile2.dat' +ENGINE=NDB; + +ALTER TABLESPACE ts1 +DROP DATAFILE 'datafile.dat' +ENGINE=NDB; + +DROP TABLESPACE ts1 +ENGINE=NDB; + +DROP LOGFILE GROUP lg1 +ENGINE=NDB; + +--echo +--echo **** End of = **** +--echo + +CREATE LOGFILE GROUP lg1 +ADD UNDOFILE 'undofile.dat' +INITIAL_SIZE 16M +UNDO_BUFFER_SIZE 1M +ENGINE NDB; + +ALTER LOGFILE GROUP lg1 +ADD UNDOFILE 'undofile02.dat' +INITIAL_SIZE 4M +ENGINE NDB; + +CREATE TABLESPACE ts1 +ADD DATAFILE 'datafile.dat' +USE LOGFILE GROUP lg1 +INITIAL_SIZE 12M +ENGINE NDB; + +ALTER TABLESPACE ts1 +ADD DATAFILE 'datafile2.dat' +INITIAL_SIZE 12M +ENGINE NDB; + +CREATE TABLE t1 +(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL) +TABLESPACE ts1 STORAGE DISK +ENGINE NDB; + +DROP TABLE t1; + +ALTER TABLESPACE ts1 +DROP DATAFILE 'datafile2.dat' +ENGINE NDB; + +ALTER TABLESPACE ts1 +DROP DATAFILE 'datafile.dat' +ENGINE NDB; + +DROP TABLESPACE ts1 +ENGINE NDB; + +DROP LOGFILE GROUP lg1 +ENGINE NDB; + +--echo **** End = And No = **** +############ End = And No = ################## + +# End 5.1 test + From f95ebd12ba95cc2b38bc7bad0a592d05f5622c2f Mon Sep 17 00:00:00 2001 From: "jmiller@mysql.com" <> Date: Wed, 11 Jan 2006 18:50:04 +0100 Subject: [PATCH 2/3] Changes done from Jonas's review of pervious commit --- mysql-test/r/ndb_dd_basic.result | 186 +++++++++++++++---------------- mysql-test/t/ndb_dd_basic.test | 186 +++++++++++++++---------------- 2 files changed, 186 insertions(+), 186 deletions(-) diff --git a/mysql-test/r/ndb_dd_basic.result b/mysql-test/r/ndb_dd_basic.result index 7edae955ca9..e2ca4e8185e 100644 --- a/mysql-test/r/ndb_dd_basic.result +++ b/mysql-test/r/ndb_dd_basic.result @@ -17,15 +17,15 @@ ALTER TABLESPACE ts1 ADD DATAFILE 'datafile02.dat' INITIAL_SIZE = 4M ENGINE=NDB; -CREATE TABLE test.t1 +CREATE TABLE t1 (pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL) TABLESPACE ts1 STORAGE DISK ENGINE=NDB; -INSERT INTO test.t1 VALUES (0, 0, 0); -SELECT * FROM test.t1; +INSERT INTO t1 VALUES (0, 0, 0); +SELECT * FROM t1; pk1 b c 0 0 0 -INSERT INTO test.t1 VALUES +INSERT INTO t1 VALUES (1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), (6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10), (11,11,11),(12,12,12),(13,13,13),(14,14,14),(15,15,15), @@ -126,7 +126,7 @@ INSERT INTO test.t1 VALUES (486,486,486),(487,487,487),(488,488,488),(489,489,489),(490,490,490), (491,491,491),(492,492,492),(493,493,493),(494,494,494),(495,495,495), (496,496,496),(497,497,497),(498,498,498),(499,499,499),(500, 500, 500); -SELECT COUNT(*) FROM test.t1; +SELECT COUNT(*) FROM t1; COUNT(*) 501 CREATE LOGFILE GROUP lg2 @@ -156,198 +156,198 @@ ADD UNDOFILE 'x.dat' INITIAL_SIZE 1000000000000K ENGINE = NDB; ERROR HY000: The size number was correct but we don't allow the digit part to be more than 2 billion -DROP TABLE test.t1; -CREATE TABLE test.t1 (a INT PRIMARY KEY, b CHAR(4) NOT NULL, c CHAR(4) NOT NULL, KEY(b)) TABLESPACE ts1 STORAGE DISK ENGINE = NDB; -INSERT INTO test.t1 VALUES (1,'1','1'), (2,'2','2'), (3,'3','3'); +DROP TABLE t1; +CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(4) NOT NULL, c CHAR(4) NOT NULL, KEY(b)) TABLESPACE ts1 STORAGE DISK ENGINE = NDB; +INSERT INTO t1 VALUES (1,'1','1'), (2,'2','2'), (3,'3','3'); BEGIN; -UPDATE test.t1 SET b = '2' WHERE a = 1; -SELECT b FROM test.t1 WHERE a = 1; +UPDATE t1 SET b = '2' WHERE a = 1; +SELECT b FROM t1 WHERE a = 1; b 2 -SELECT * FROM test.t1 WHERE a = 1; +SELECT * FROM t1 WHERE a = 1; a b c 1 2 1 -UPDATE test.t1 SET c = '2' WHERE a = 1; -SELECT b FROM test.t1 WHERE a = 1; +UPDATE t1 SET c = '2' WHERE a = 1; +SELECT b FROM t1 WHERE a = 1; b 2 -SELECT * FROM test.t1 WHERE a = 1; +SELECT * FROM t1 WHERE a = 1; a b c 1 2 2 -UPDATE test.t1 SET b = '3' WHERE a = 1; -SELECT b FROM test.t1 WHERE a = 1; +UPDATE t1 SET b = '3' WHERE a = 1; +SELECT b FROM t1 WHERE a = 1; b 3 -SELECT * FROM test.t1 WHERE a = 1; +SELECT * FROM t1 WHERE a = 1; a b c 1 3 2 COMMIT; -SELECT * FROM test.t1 ORDER BY 1; +SELECT * FROM t1 ORDER BY 1; a b c 1 3 2 2 2 2 3 3 3 BEGIN; -UPDATE test.t1 SET c = '3' WHERE a = 1; -SELECT b FROM test.t1 WHERE a = 1; +UPDATE t1 SET c = '3' WHERE a = 1; +SELECT b FROM t1 WHERE a = 1; b 3 -SELECT * FROM test.t1 WHERE a = 1; +SELECT * FROM t1 WHERE a = 1; a b c 1 3 3 -UPDATE test.t1 SET b = '4' WHERE a = 1; -SELECT b FROM test.t1 WHERE a = 1; +UPDATE t1 SET b = '4' WHERE a = 1; +SELECT b FROM t1 WHERE a = 1; b 4 -SELECT * FROM test.t1 WHERE a = 1; +SELECT * FROM t1 WHERE a = 1; a b c 1 4 3 -UPDATE test.t1 SET c = '4' WHERE a = 1; -SELECT b FROM test.t1 WHERE a = 1; +UPDATE t1 SET c = '4' WHERE a = 1; +SELECT b FROM t1 WHERE a = 1; b 4 -SELECT * FROM test.t1 WHERE a = 1; +SELECT * FROM t1 WHERE a = 1; a b c 1 4 4 COMMIT; -SELECT * FROM test.t1 ORDER BY 1; +SELECT * FROM t1 ORDER BY 1; a b c 1 4 4 2 2 2 3 3 3 -UPDATE test.t1 SET b = '5' WHERE a = 1; -SELECT * FROM test.t1 ORDER BY 1; +UPDATE t1 SET b = '5' WHERE a = 1; +SELECT * FROM t1 ORDER BY 1; a b c 1 5 4 2 2 2 3 3 3 -UPDATE test.t1 SET b = '6' WHERE b = '5'; -SELECT * FROM test.t1 ORDER BY 1; +UPDATE t1 SET b = '6' WHERE b = '5'; +SELECT * FROM t1 ORDER BY 1; a b c 1 6 4 2 2 2 3 3 3 -UPDATE test.t1 SET b = '7'WHERE c = '4'; -SELECT * FROM test.t1 ORDER BY 1; +UPDATE t1 SET b = '7'WHERE c = '4'; +SELECT * FROM t1 ORDER BY 1; a b c 1 7 4 2 2 2 3 3 3 -UPDATE test.t1 SET c = '5' WHERE a = 1; -SELECT * FROM test.t1 ORDER BY 1; +UPDATE t1 SET c = '5' WHERE a = 1; +SELECT * FROM t1 ORDER BY 1; a b c 1 7 5 2 2 2 3 3 3 -UPDATE test.t1 SET c = '6' WHERE b = '7'; -SELECT * FROM test.t1 ORDER BY 1; +UPDATE t1 SET c = '6' WHERE b = '7'; +SELECT * FROM t1 ORDER BY 1; a b c 1 7 6 2 2 2 3 3 3 -UPDATE test.t1 SET c = '7' WHERE c = '6'; -SELECT * FROM test.t1 ORDER BY 1; +UPDATE t1 SET c = '7' WHERE c = '6'; +SELECT * FROM t1 ORDER BY 1; a b c 1 7 7 2 2 2 3 3 3 -DROP TABLE test.t1; -CREATE TABLE test.t1 (a INT PRIMARY KEY, b VARCHAR(4) NOT NULL, c CHAR(4) NOT NULL, KEY(b)) TABLESPACE ts1 STORAGE DISK ENGINE NDB; -INSERT INTO test.t1 VALUE (1,'1','1'), (2,'2','2'), (3,'3','3'); +DROP TABLE t1; +CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(4) NOT NULL, c CHAR(4) NOT NULL, KEY(b)) TABLESPACE ts1 STORAGE DISK ENGINE NDB; +INSERT INTO t1 VALUE (1,'1','1'), (2,'2','2'), (3,'3','3'); BEGIN; -UPDATE test.t1 SET b = '2' WHERE a = 1; -SELECT b FROM test.t1 WHERE a = 1; +UPDATE t1 SET b = '2' WHERE a = 1; +SELECT b FROM t1 WHERE a = 1; b 2 -SELECT * FROM test.t1 WHERE a = 1; +SELECT * FROM t1 WHERE a = 1; a b c 1 2 1 -UPDATE test.t1 SET c = '2' WHERE a = 1; -SELECT b FROM test.t1 WHERE a = 1; +UPDATE t1 SET c = '2' WHERE a = 1; +SELECT b FROM t1 WHERE a = 1; b 2 -SELECT * FROM test.t1 WHERE a = 1; +SELECT * FROM t1 WHERE a = 1; a b c 1 2 2 -UPDATE test.t1 SET b = '3' WHERE a = 1; -SELECT b FROM test.t1 WHERE a = 1; +UPDATE t1 SET b = '3' WHERE a = 1; +SELECT b FROM t1 WHERE a = 1; b 3 -SELECT * FROM test.t1 WHERE a = 1; +SELECT * FROM t1 WHERE a = 1; a b c 1 3 2 COMMIT; -SELECT * FROM test.t1 ORDER BY 1; +SELECT * FROM t1 ORDER BY 1; a b c 1 3 2 2 2 2 3 3 3 BEGIN; -UPDATE test.t1 SET c = '3' WHERE a = 1; -SELECT b FROM test.t1 WHERE a = 1; +UPDATE t1 SET c = '3' WHERE a = 1; +SELECT b FROM t1 WHERE a = 1; b 3 -SELECT * FROM test.t1 WHERE a = 1; +SELECT * FROM t1 WHERE a = 1; a b c 1 3 3 -UPDATE test.t1 SET b = '4' WHERE a = 1; -SELECT b FROM test.t1 WHERE a = 1; +UPDATE t1 SET b = '4' WHERE a = 1; +SELECT b FROM t1 WHERE a = 1; b 4 -SELECT * FROM test.t1 WHERE a = 1; +SELECT * FROM t1 WHERE a = 1; a b c 1 4 3 -UPDATE test.t1 SET c = '4' WHERE a = 1; -SELECT b FROM test.t1 WHERE a = 1; +UPDATE t1 SET c = '4' WHERE a = 1; +SELECT b FROM t1 WHERE a = 1; b 4 -SELECT * FROM test.t1 WHERE a = 1; +SELECT * FROM t1 WHERE a = 1; a b c 1 4 4 COMMIT; -SELECT * FROM test.t1 ORDER BY 1; +SELECT * FROM t1 ORDER BY 1; a b c 1 4 4 2 2 2 3 3 3 -UPDATE test.t1 SET b = '5' WHERE a = 1; -SELECT * FROM test.t1 ORDER BY 1; +UPDATE t1 SET b = '5' WHERE a = 1; +SELECT * FROM t1 ORDER BY 1; a b c 1 5 4 2 2 2 3 3 3 -UPDATE test.t1 SET b = '6' WHERE b = '5'; -SELECT * FROM test.t1 ORDER BY 1; +UPDATE t1 SET b = '6' WHERE b = '5'; +SELECT * FROM t1 ORDER BY 1; a b c 1 6 4 2 2 2 3 3 3 -UPDATE test.t1 SET b = '7' WHERE c = '4'; -SELECT * FROM test.t1 ORDER BY 1; +UPDATE t1 SET b = '7' WHERE c = '4'; +SELECT * FROM t1 ORDER BY 1; a b c 1 7 4 2 2 2 3 3 3 -UPDATE test.t1 SET c = '5' WHERE a = 1; -SELECT * FROM test.t1 ORDER BY 1; +UPDATE t1 SET c = '5' WHERE a = 1; +SELECT * FROM t1 ORDER BY 1; a b c 1 7 5 2 2 2 3 3 3 -UPDATE test.t1 SET c = '6' WHERE b = '7'; -SELECT * FROM test.t1 ORDER BY 1; +UPDATE t1 SET c = '6' WHERE b = '7'; +SELECT * FROM t1 ORDER BY 1; a b c 1 7 6 2 2 2 3 3 3 -UPDATE test.t1 SET c = '7' WHERE c = '6'; -SELECT * FROM test.t1 ORDER BY 1; +UPDATE t1 SET c = '7' WHERE c = '6'; +SELECT * FROM t1 ORDER BY 1; a b c 1 7 7 2 2 2 3 3 3 -DROP TABLE test.t1; -CREATE TABLE test.t1 ( +DROP TABLE t1; +CREATE TABLE t1 ( a INT NOT NULL PRIMARY KEY, b TEXT NOT NULL ) TABLESPACE ts1 STORAGE DISK ENGINE=NDBCLUSTER; @@ -363,36 +363,36 @@ set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2); set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2); set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2); set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2); -INSERT INTO test.t1 VALUES(1,@b1); -INSERT INTO test.t1 VALUES(2,@b2); -SELECT a,length(b),substr(b,1+2*900,2) FROM test.t1 WHERE a=1; +INSERT INTO t1 VALUES(1,@b1); +INSERT INTO t1 VALUES(2,@b2); +SELECT a,length(b),substr(b,1+2*900,2) FROM t1 WHERE a=1; a length(b) substr(b,1+2*900,2) 1 2256 b1 -SELECT a,length(b),substr(b,1+2*9000,2) FROM test.t1 WHERE a=2; +SELECT a,length(b),substr(b,1+2*9000,2) FROM t1 WHERE a=2; a length(b) substr(b,1+2*9000,2) 2 20000 b2 -UPDATE test.t1 SET b=@b2 WHERE a=1; -UPDATE test.t1 SET b=@b1 WHERE a=2; -SELECT a,length(b),substr(b,1+2*9000,2) FROM test.t1 WHERE a=1; +UPDATE t1 SET b=@b2 WHERE a=1; +UPDATE t1 SET b=@b1 WHERE a=2; +SELECT a,length(b),substr(b,1+2*9000,2) FROM t1 WHERE a=1; a length(b) substr(b,1+2*9000,2) 1 20000 b2 -SELECT a,length(b),substr(b,1+2*900,2) FROM test.t1 WHERE a=2; +SELECT a,length(b),substr(b,1+2*900,2) FROM t1 WHERE a=2; a length(b) substr(b,1+2*900,2) 2 2256 b1 -UPDATE test.t1 SET b=concat(b,b) WHERE a=1; -UPDATE test.t1 SET b=concat(b,b) WHERE a=2; -SELECT a,length(b),substr(b,1+4*9000,2) FROM test.t1 WHERE a=1; +UPDATE t1 SET b=concat(b,b) WHERE a=1; +UPDATE t1 SET b=concat(b,b) WHERE a=2; +SELECT a,length(b),substr(b,1+4*9000,2) FROM t1 WHERE a=1; a length(b) substr(b,1+4*9000,2) 1 40000 b2 -SELECT a,length(b),substr(b,1+4*900,2) FROM test.t1 WHERE a=2; +SELECT a,length(b),substr(b,1+4*900,2) FROM t1 WHERE a=2; a length(b) substr(b,1+4*900,2) 2 4512 b1 -DELETE FROM test.t1 WHERE a=1; -DELETE FROM test.t1 WHERE a=2; -SELECT COUNT(*) FROM test.t1; +DELETE FROM t1 WHERE a=1; +DELETE FROM t1 WHERE a=2; +SELECT COUNT(*) FROM t1; COUNT(*) 0 -DROP TABLE test.t1; +DROP TABLE t1; ALTER TABLESPACE ts1 DROP DATAFILE 'datafile.dat' ENGINE = NDB; diff --git a/mysql-test/t/ndb_dd_basic.test b/mysql-test/t/ndb_dd_basic.test index 97e84ea78cc..d9e7fcc7ca7 100644 --- a/mysql-test/t/ndb_dd_basic.test +++ b/mysql-test/t/ndb_dd_basic.test @@ -49,15 +49,15 @@ ENGINE=NDB; # Create a table using this tablespace ######################################## -CREATE TABLE test.t1 +CREATE TABLE t1 (pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL) TABLESPACE ts1 STORAGE DISK ENGINE=NDB; -INSERT INTO test.t1 VALUES (0, 0, 0); -SELECT * FROM test.t1; +INSERT INTO t1 VALUES (0, 0, 0); +SELECT * FROM t1; -INSERT INTO test.t1 VALUES +INSERT INTO t1 VALUES (1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), (6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10), (11,11,11),(12,12,12),(13,13,13),(14,14,14),(15,15,15), @@ -159,7 +159,7 @@ INSERT INTO test.t1 VALUES (491,491,491),(492,492,492),(493,493,493),(494,494,494),(495,495,495), (496,496,496),(497,497,497),(498,498,498),(499,499,499),(500, 500, 500); -SELECT COUNT(*) FROM test.t1; +SELECT COUNT(*) FROM t1; #################################### # Test error cases with size numbers @@ -194,99 +194,99 @@ ADD UNDOFILE 'x.dat' INITIAL_SIZE 1000000000000K ENGINE = NDB; -DROP TABLE test.t1; +DROP TABLE t1; ############################ # Test update of mm/dd part ############################ -CREATE TABLE test.t1 (a INT PRIMARY KEY, b CHAR(4) NOT NULL, c CHAR(4) NOT NULL, KEY(b)) TABLESPACE ts1 STORAGE DISK ENGINE = NDB; -INSERT INTO test.t1 VALUES (1,'1','1'), (2,'2','2'), (3,'3','3'); +CREATE TABLE t1 (a INT PRIMARY KEY, b CHAR(4) NOT NULL, c CHAR(4) NOT NULL, KEY(b)) TABLESPACE ts1 STORAGE DISK ENGINE = NDB; +INSERT INTO t1 VALUES (1,'1','1'), (2,'2','2'), (3,'3','3'); BEGIN; -UPDATE test.t1 SET b = '2' WHERE a = 1; -SELECT b FROM test.t1 WHERE a = 1; -SELECT * FROM test.t1 WHERE a = 1; -UPDATE test.t1 SET c = '2' WHERE a = 1; -SELECT b FROM test.t1 WHERE a = 1; -SELECT * FROM test.t1 WHERE a = 1; -UPDATE test.t1 SET b = '3' WHERE a = 1; -SELECT b FROM test.t1 WHERE a = 1; -SELECT * FROM test.t1 WHERE a = 1; +UPDATE t1 SET b = '2' WHERE a = 1; +SELECT b FROM t1 WHERE a = 1; +SELECT * FROM t1 WHERE a = 1; +UPDATE t1 SET c = '2' WHERE a = 1; +SELECT b FROM t1 WHERE a = 1; +SELECT * FROM t1 WHERE a = 1; +UPDATE t1 SET b = '3' WHERE a = 1; +SELECT b FROM t1 WHERE a = 1; +SELECT * FROM t1 WHERE a = 1; COMMIT; -SELECT * FROM test.t1 ORDER BY 1; +SELECT * FROM t1 ORDER BY 1; BEGIN; -UPDATE test.t1 SET c = '3' WHERE a = 1; -SELECT b FROM test.t1 WHERE a = 1; -SELECT * FROM test.t1 WHERE a = 1; -UPDATE test.t1 SET b = '4' WHERE a = 1; -SELECT b FROM test.t1 WHERE a = 1; -SELECT * FROM test.t1 WHERE a = 1; -UPDATE test.t1 SET c = '4' WHERE a = 1; -SELECT b FROM test.t1 WHERE a = 1; -SELECT * FROM test.t1 WHERE a = 1; +UPDATE t1 SET c = '3' WHERE a = 1; +SELECT b FROM t1 WHERE a = 1; +SELECT * FROM t1 WHERE a = 1; +UPDATE t1 SET b = '4' WHERE a = 1; +SELECT b FROM t1 WHERE a = 1; +SELECT * FROM t1 WHERE a = 1; +UPDATE t1 SET c = '4' WHERE a = 1; +SELECT b FROM t1 WHERE a = 1; +SELECT * FROM t1 WHERE a = 1; COMMIT; -SELECT * FROM test.t1 ORDER BY 1; -UPDATE test.t1 SET b = '5' WHERE a = 1; -SELECT * FROM test.t1 ORDER BY 1; -UPDATE test.t1 SET b = '6' WHERE b = '5'; -SELECT * FROM test.t1 ORDER BY 1; -UPDATE test.t1 SET b = '7'WHERE c = '4'; -SELECT * FROM test.t1 ORDER BY 1; -UPDATE test.t1 SET c = '5' WHERE a = 1; -SELECT * FROM test.t1 ORDER BY 1; -UPDATE test.t1 SET c = '6' WHERE b = '7'; -SELECT * FROM test.t1 ORDER BY 1; -UPDATE test.t1 SET c = '7' WHERE c = '6'; -SELECT * FROM test.t1 ORDER BY 1; -DROP TABLE test.t1; +SELECT * FROM t1 ORDER BY 1; +UPDATE t1 SET b = '5' WHERE a = 1; +SELECT * FROM t1 ORDER BY 1; +UPDATE t1 SET b = '6' WHERE b = '5'; +SELECT * FROM t1 ORDER BY 1; +UPDATE t1 SET b = '7'WHERE c = '4'; +SELECT * FROM t1 ORDER BY 1; +UPDATE t1 SET c = '5' WHERE a = 1; +SELECT * FROM t1 ORDER BY 1; +UPDATE t1 SET c = '6' WHERE b = '7'; +SELECT * FROM t1 ORDER BY 1; +UPDATE t1 SET c = '7' WHERE c = '6'; +SELECT * FROM t1 ORDER BY 1; +DROP TABLE t1; ##### -CREATE TABLE test.t1 (a INT PRIMARY KEY, b VARCHAR(4) NOT NULL, c CHAR(4) NOT NULL, KEY(b)) TABLESPACE ts1 STORAGE DISK ENGINE NDB; -INSERT INTO test.t1 VALUE (1,'1','1'), (2,'2','2'), (3,'3','3'); +CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(4) NOT NULL, c CHAR(4) NOT NULL, KEY(b)) TABLESPACE ts1 STORAGE DISK ENGINE NDB; +INSERT INTO t1 VALUE (1,'1','1'), (2,'2','2'), (3,'3','3'); BEGIN; -UPDATE test.t1 SET b = '2' WHERE a = 1; -SELECT b FROM test.t1 WHERE a = 1; -SELECT * FROM test.t1 WHERE a = 1; -UPDATE test.t1 SET c = '2' WHERE a = 1; -SELECT b FROM test.t1 WHERE a = 1; -SELECT * FROM test.t1 WHERE a = 1; -UPDATE test.t1 SET b = '3' WHERE a = 1; -SELECT b FROM test.t1 WHERE a = 1; -SELECT * FROM test.t1 WHERE a = 1; +UPDATE t1 SET b = '2' WHERE a = 1; +SELECT b FROM t1 WHERE a = 1; +SELECT * FROM t1 WHERE a = 1; +UPDATE t1 SET c = '2' WHERE a = 1; +SELECT b FROM t1 WHERE a = 1; +SELECT * FROM t1 WHERE a = 1; +UPDATE t1 SET b = '3' WHERE a = 1; +SELECT b FROM t1 WHERE a = 1; +SELECT * FROM t1 WHERE a = 1; COMMIT; -SELECT * FROM test.t1 ORDER BY 1; +SELECT * FROM t1 ORDER BY 1; BEGIN; -UPDATE test.t1 SET c = '3' WHERE a = 1; -SELECT b FROM test.t1 WHERE a = 1; -SELECT * FROM test.t1 WHERE a = 1; -UPDATE test.t1 SET b = '4' WHERE a = 1; -SELECT b FROM test.t1 WHERE a = 1; -SELECT * FROM test.t1 WHERE a = 1; -UPDATE test.t1 SET c = '4' WHERE a = 1; -SELECT b FROM test.t1 WHERE a = 1; -SELECT * FROM test.t1 WHERE a = 1; +UPDATE t1 SET c = '3' WHERE a = 1; +SELECT b FROM t1 WHERE a = 1; +SELECT * FROM t1 WHERE a = 1; +UPDATE t1 SET b = '4' WHERE a = 1; +SELECT b FROM t1 WHERE a = 1; +SELECT * FROM t1 WHERE a = 1; +UPDATE t1 SET c = '4' WHERE a = 1; +SELECT b FROM t1 WHERE a = 1; +SELECT * FROM t1 WHERE a = 1; COMMIT; -SELECT * FROM test.t1 ORDER BY 1; -UPDATE test.t1 SET b = '5' WHERE a = 1; -SELECT * FROM test.t1 ORDER BY 1; -UPDATE test.t1 SET b = '6' WHERE b = '5'; -SELECT * FROM test.t1 ORDER BY 1; -UPDATE test.t1 SET b = '7' WHERE c = '4'; -SELECT * FROM test.t1 ORDER BY 1; -UPDATE test.t1 SET c = '5' WHERE a = 1; -SELECT * FROM test.t1 ORDER BY 1; -UPDATE test.t1 SET c = '6' WHERE b = '7'; -SELECT * FROM test.t1 ORDER BY 1; -UPDATE test.t1 SET c = '7' WHERE c = '6'; -SELECT * FROM test.t1 ORDER BY 1; -DROP TABLE test.t1; +SELECT * FROM t1 ORDER BY 1; +UPDATE t1 SET b = '5' WHERE a = 1; +SELECT * FROM t1 ORDER BY 1; +UPDATE t1 SET b = '6' WHERE b = '5'; +SELECT * FROM t1 ORDER BY 1; +UPDATE t1 SET b = '7' WHERE c = '4'; +SELECT * FROM t1 ORDER BY 1; +UPDATE t1 SET c = '5' WHERE a = 1; +SELECT * FROM t1 ORDER BY 1; +UPDATE t1 SET c = '6' WHERE b = '7'; +SELECT * FROM t1 ORDER BY 1; +UPDATE t1 SET c = '7' WHERE c = '6'; +SELECT * FROM t1 ORDER BY 1; +DROP TABLE t1; ######################## # Test for blobs... ######################## -CREATE TABLE test.t1 ( +CREATE TABLE t1 ( a INT NOT NULL PRIMARY KEY, b TEXT NOT NULL ) TABLESPACE ts1 STORAGE DISK ENGINE=NDBCLUSTER; @@ -308,22 +308,22 @@ set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2); set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2); set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2); -INSERT INTO test.t1 VALUES(1,@b1); -INSERT INTO test.t1 VALUES(2,@b2); -SELECT a,length(b),substr(b,1+2*900,2) FROM test.t1 WHERE a=1; -SELECT a,length(b),substr(b,1+2*9000,2) FROM test.t1 WHERE a=2; -UPDATE test.t1 SET b=@b2 WHERE a=1; -UPDATE test.t1 SET b=@b1 WHERE a=2; -SELECT a,length(b),substr(b,1+2*9000,2) FROM test.t1 WHERE a=1; -SELECT a,length(b),substr(b,1+2*900,2) FROM test.t1 WHERE a=2; -UPDATE test.t1 SET b=concat(b,b) WHERE a=1; -UPDATE test.t1 SET b=concat(b,b) WHERE a=2; -SELECT a,length(b),substr(b,1+4*9000,2) FROM test.t1 WHERE a=1; -SELECT a,length(b),substr(b,1+4*900,2) FROM test.t1 WHERE a=2; -DELETE FROM test.t1 WHERE a=1; -DELETE FROM test.t1 WHERE a=2; -SELECT COUNT(*) FROM test.t1; -DROP TABLE test.t1; +INSERT INTO t1 VALUES(1,@b1); +INSERT INTO t1 VALUES(2,@b2); +SELECT a,length(b),substr(b,1+2*900,2) FROM t1 WHERE a=1; +SELECT a,length(b),substr(b,1+2*9000,2) FROM t1 WHERE a=2; +UPDATE t1 SET b=@b2 WHERE a=1; +UPDATE t1 SET b=@b1 WHERE a=2; +SELECT a,length(b),substr(b,1+2*9000,2) FROM t1 WHERE a=1; +SELECT a,length(b),substr(b,1+2*900,2) FROM t1 WHERE a=2; +UPDATE t1 SET b=concat(b,b) WHERE a=1; +UPDATE t1 SET b=concat(b,b) WHERE a=2; +SELECT a,length(b),substr(b,1+4*9000,2) FROM t1 WHERE a=1; +SELECT a,length(b),substr(b,1+4*900,2) FROM t1 WHERE a=2; +DELETE FROM t1 WHERE a=1; +DELETE FROM t1 WHERE a=2; +SELECT COUNT(*) FROM t1; +DROP TABLE t1; ################### # Test Cleanup From 0a0fe2b1c0d4b49a696f918603a934ec0225cea3 Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.ndb.mysql.com" <> Date: Wed, 11 Jan 2006 19:49:38 +0100 Subject: [PATCH 3/3] bug: replication of table spaces to work bug: check if storage engine is enabled to avoif code dump --- .bzrignore | 9 +++++++++ sql/sql_tablespace.cc | 8 +++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.bzrignore b/.bzrignore index 4a2a3d98101..0b1ec285d88 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1661,3 +1661,12 @@ zlib/*.vcproj client/mysqlslap storage/archive/archive_test item_xmlfunc.cc +storage/ndb/test/ndbapi/DbAsyncGenerator +storage/ndb/test/ndbapi/DbCreate +storage/ndb/test/ndbapi/ndbapi_slow_select +storage/ndb/test/ndbapi/testBitfield +storage/ndb/test/ndbapi/testLcp +storage/ndb/test/ndbapi/testPartitioning +storage/ndb/test/ndbapi/testReadPerf +storage/ndb/test/ndbapi/test_event_merge +storage/ndb/test/tools/listen_event diff --git a/sql/sql_tablespace.cc b/sql/sql_tablespace.cc index 0c99180365e..954d65ea44e 100644 --- a/sql/sql_tablespace.cc +++ b/sql/sql_tablespace.cc @@ -30,7 +30,8 @@ int mysql_alter_tablespace(THD *thd, st_alter_tablespace *ts_info) */ hton= ha_resolve_by_legacy_type(thd, ts_info->storage_engine); - if (hton->alter_tablespace && (error= hton->alter_tablespace(thd, ts_info))) + if (hton->state == SHOW_OPTION_YES && + hton->alter_tablespace && (error= hton->alter_tablespace(thd, ts_info))) { if (error == HA_ADMIN_NOT_IMPLEMENTED) { @@ -46,5 +47,10 @@ int mysql_alter_tablespace(THD *thd, st_alter_tablespace *ts_info) } DBUG_RETURN(error); } + if (mysql_bin_log.is_open()) + { + thd->binlog_query(THD::STMT_QUERY_TYPE, + thd->query, thd->query_length, FALSE, TRUE); + } DBUG_RETURN(FALSE); }