diff options
author | unknown <magnus@neptunus.(none)> | 2004-09-30 14:20:14 +0200 |
---|---|---|
committer | unknown <magnus@neptunus.(none)> | 2004-09-30 14:20:14 +0200 |
commit | b7c3591b326c3bc4376a84152e9acc6689bf686b (patch) | |
tree | aa85068bff143082a525eb016dea3830dab4f21b /mysql-test/t/ndb_autodiscover.test | |
parent | 66657ba1b59f007e08aef183770a63b76c6597b1 (diff) | |
download | mariadb-git-b7c3591b326c3bc4376a84152e9acc6689bf686b.tar.gz |
WL#1424 Added more advanced test cases for autodiscovery
mysql-test/mysql-test-run.sh:
Create and export an NDB_CONNECSTRING that can be used for NDB_TOOLS to connect to NDB
mysql-test/r/ndb_autodiscover.result:
Added more advanced test cases for ndb_autodiscover
mysql-test/t/ndb_autodiscover.test:
Added more advanced test cases for ndb_autodiscover
Diffstat (limited to 'mysql-test/t/ndb_autodiscover.test')
-rw-r--r-- | mysql-test/t/ndb_autodiscover.test | 206 |
1 files changed, 159 insertions, 47 deletions
diff --git a/mysql-test/t/ndb_autodiscover.test b/mysql-test/t/ndb_autodiscover.test index 50c94d7a6e4..13ec01cfb85 100644 --- a/mysql-test/t/ndb_autodiscover.test +++ b/mysql-test/t/ndb_autodiscover.test @@ -1,7 +1,7 @@ -- source include/have_ndb.inc --disable_warnings -drop table if exists t1,t2,t3,t4,t5,t6,t7,t9; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; --enable_warnings ################################################ @@ -189,38 +189,27 @@ drop table t6, t7; # saying "No such table existed" # -# Commented out, to be fixed -# +flush status; + +create table t4( + id int not null primary key, + name char(27) +) engine=ndb; +insert into t4 values (1, "Automatic"); +select * from t4; -#flush status; -# -#create table t4( -# id int not null primary key, -# name char(27) -#) engine=ndb; -#insert into t4 values (1, "Automatic"); -#select * from t4; -# # Remove the table from NDB -#system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t4 > /dev/null ; +system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t4 > /dev/null ; -#system exec ../ndb/tools/ndb_show_tables > var/log/ndb_show_tables.log; # # Test that correct error is returned -#--error 1146 -#select * from t4; -#--error 1146 -#select * from t4; -# -#show status like 'handler_discover%'; -#drop table t4; -# -# -# system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t4 > /dev/null ; -# -# -# -#show tables; +--error 1146 +select * from t4; +--error 1146 +select * from t4; + +show status like 'handler_discover%'; +drop table t4; ####################################################### @@ -228,29 +217,153 @@ drop table t6, t7; # but still exists on disk is deleted from disk # when SHOW TABLES is called # + +flush status; + +create table t4( + id int not null primary key, + id2 int, + name char(27) +) engine=ndb; +insert into t4 values (1, 76, "Automatic2"); +select * from t4; +flush tables; + +# Remove the table from NDB +system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t4 > /dev/null ; + +SHOW TABLES; + +--error 1146 +select * from t4; + +####################################################### +# Test SHOW TABLES ability to detect new and delete old +# tables. Test all at once using many tables # -#flush status; + +flush status; + +# Create tables +create table t1(id int) engine=ndbcluster; +create table t2(id int, b char(255)) engine=myisam; +create table t3(id int, c char(255)) engine=ndbcluster; +create table t4(id int) engine=myisam; +create table t5(id int, d char(56)) engine=ndbcluster; +create table t6(id int) engine=ndbcluster; +create table t7(id int) engine=ndbcluster; +create table t8(id int, e char(34)) engine=myisam; +create table t9(id int) engine=myisam; + +# Populate tables +insert into t2 values (2, "myisam table 2"); +insert into t3 values (3, "ndb table 3"); +insert into t5 values (5, "ndb table 5"); +insert into t6 values (6); +insert into t8 values (8, "myisam table 8"); +insert into t9 values (9); + +# Remove t3, t5 from NDB +system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t3 > /dev/null ; +system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t5 > /dev/null ; +# Remove t6, t7 from disk +system rm var/master-data/test/t6.frm > /dev/null ; +system rm var/master-data/test/t7.frm > /dev/null ; + +SHOW TABLES; + +select * from t6; +select * from t7; + +show status like 'handler_discover%'; + +drop table t1, t2, t4, t6, t7, t8, t9; + +####################################################### +# Test SHOW TABLES LIKE ability to detect new and delete old +# tables. Test all at once using many tables. # -#create table t4( -# id int not null primary key, -# id2 int, -# name char(27) -#) engine=ndb; -#insert into t4 values (1, 76, "Automatic2"); -#select * from t4; -#flush tables; + +flush status; + +# Create tables +create table t1(id int) engine=ndbcluster; +create table t2(id int, b char(255)) engine=myisam; +create table t3(id int, c char(255)) engine=ndbcluster; +create table t4(id int) engine=myisam; +create table t5(id int, d char(56)) engine=ndbcluster; +create table t6(id int) engine=ndbcluster; +create table t7(id int) engine=ndbcluster; +create table t8(id int, e char(34)) engine=myisam; +create table t9(id int) engine=myisam; + +# Populate tables +insert into t2 values (2, "myisam table 2"); +insert into t3 values (3, "ndb table 3"); +insert into t5 values (5, "ndb table 5"); +insert into t6 values (6); +insert into t8 values (8, "myisam table 8"); +insert into t9 values (9); + +# Remove t3, t5 from NDB +system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t3 > /dev/null ; +system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t5 > /dev/null ; +# Remove t6, t7 from disk +system rm var/master-data/test/t6.frm > /dev/null ; +system rm var/master-data/test/t7.frm > /dev/null ; + + +SHOW TABLES LIKE 't6'; + +show status like 'handler_discover%'; + +# Check that t3 or t5 can't be created +# frm files for these tables is stilll on disk +--error 1050 +create table t3(a int); +--error 1050 +create table t5(a int); + +SHOW TABLES LIKE 't%'; + +show status like 'handler_discover%'; + +drop table t1, t2, t4, t6, t7, t8, t9; + + + +###################################################### +# Test that several tables can be discovered when +# one statement access several table at once. # -# Remove the table from NDB -#system exec ../ndb/tools/ndb_drop_table -c localhost:9350 -d test t4 > /dev/null ; -#system exec ../ndb/tools/ndb_show_tables > var/log/ndb_show_tables.log; +flush status; -#SHOW TABLES; +# Create tables +create table t1(id int) engine=ndbcluster; +create table t2(id int, b char(255)) engine=ndbcluster; +create table t3(id int, c char(255)) engine=ndbcluster; +create table t4(id int) engine=myisam; + +# Populate tables +insert into t1 values (1); +insert into t2 values (2, "table 2"); +insert into t3 values (3, "ndb table 3"); +insert into t4 values (4); + +# Remove t1, t2, t3 from disk +system rm var/master-data/test/t1.frm > /dev/null ; +system rm var/master-data/test/t2.frm > /dev/null ; +system rm var/master-data/test/t3.frm > /dev/null ; +flush tables; -# Is there another way to find out that the file is gone? -#--error 1146 -#select * from t4; +# Select from the table which only exists in NDB. +select * from t1, t2, t3, t4; +# 3 table should have been discovered +show status like 'handler_discover%'; + +drop table t1, t2, t3, t4; ######################################################### @@ -334,6 +447,5 @@ system rm var/master-data/test/t9.frm ; # MySQL Server will have been restarted because it has a # ndb_autodiscover2-master.opt file. -#TODO -#SLECT * FROM t1, t2, t4; -#handler discover 3; + + |