diff options
Diffstat (limited to 'storage/connect/mysql-test/connect/t/tbl_thread.test')
-rw-r--r-- | storage/connect/mysql-test/connect/t/tbl_thread.test | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/storage/connect/mysql-test/connect/t/tbl_thread.test b/storage/connect/mysql-test/connect/t/tbl_thread.test new file mode 100644 index 00000000000..abc1ef34729 --- /dev/null +++ b/storage/connect/mysql-test/connect/t/tbl_thread.test @@ -0,0 +1,90 @@ +-- source myconn.inc + +connection default; + +let $PORT= `select @@port`; + +--echo # +--echo # Checking thread TBL tables +--echo # +CREATE TABLE t1 (a int, b char(10)); +INSERT INTO t1 VALUES (0,'test00'),(1,'test01'),(2,'test02'),(3,'test03'); +SELECT * FROM t1; + +connection master; + +CREATE TABLE rt2 (a int, b char(10)); +INSERT INTO rt2 VALUES (4,'test04'),(5,'test05'),(6,'test06'),(7,'test07'); +SELECT * FROM rt2; + +connection slave; + +USE test; +CREATE TABLE rt3 (a int, b char(10)); +INSERT INTO rt3 VALUES (8,'test08'),(9,'test09'),(10,'test10'),(11,'test11'); +SELECT * FROM rt3; + +connection default; + +--replace_result $MASTER_MYPORT MASTER_PORT +eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL +CONNECTION='mysql://root@127.0.0.1:$MASTER_MYPORT/test/rt2'; +SELECT * FROM t2; + +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval CREATE TABLE t3 ENGINE=CONNECT TABLE_TYPE=MYSQL +CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/rt3'; +SELECT * FROM t3; + +--replace_result $PORT PORT +eval CREATE TABLE total (a int, b char(10)) +ENGINE=CONNECT TABLE_TYPE=TBL TABLE_LIST='t1,t2,t3' +OPTION_LIST='thread=yes,port=$PORT'; +SELECT * FROM total order by a desc; + +connection master; + +DROP TABLE rt2; + +connection slave; + +DROP TABLE rt3; + +connection default; + +DROP TABLE t1,t2,t3,total; + +--echo # +--echo # Old thread TBL tables test modified +--echo # +--replace_result $MASTER_MYPORT MASTER_PORT +--eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL SRCDEF='select 11 as v' OPTION_LIST='port=$MASTER_MYPORT' +SELECT * FROM t1; + +--replace_result $SLAVE_MYPORT SLAVE_PORT +--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL SRCDEF='select 22 as v' OPTION_LIST='port=$SLAVE_MYPORT' +SELECT * FROM t2; + +--replace_result $PORT PORT +--eval CREATE TABLE total (v BIGINT(20) UNSIGNED NOT NULL) ENGINE=CONNECT TABLE_TYPE=TBL TABLE_LIST='t1,t2' OPTION_LIST='thread=yes,port=$PORT'; +SELECT * FROM total order by v desc; +DROP TABLE t1,t2,total; + +--echo # +--echo # Old thread TBL tables test not modified +--echo # +CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL SRCDEF='select 11 as v'; +SELECT * FROM t1; + +CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL SRCDEF='select 22 as v'; +SELECT * FROM t2; + +--replace_result $PORT PORT +--eval CREATE TABLE total (v BIGINT(20) UNSIGNED NOT NULL) ENGINE=CONNECT TABLE_TYPE=TBL TABLE_LIST='t1,t2' OPTION_LIST='thread=yes,port=$PORT'; +SELECT * FROM total order by v desc; + +DROP TABLE total; +DROP TABLE t1; +DROP TABLE t2; + +-- source myconn_cleanup.inc |