summaryrefslogtreecommitdiff
path: root/storage/connect/mysql-test/connect/t/tbl.test
blob: 43c506c9403516328f75219b8b6d19f1c1907cc6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
-- source include/not_embedded.inc

let $MYSQLD_DATADIR= `select @@datadir`;
let $PORT= `select @@port`;

--echo #
--echo # Checking TBL tables
--echo #
CREATE TABLE t1 (
a INT NOT NULL,
message CHAR(10)) ENGINE=connect;
INSERT INTO t1 VALUES (1,'Testing'),(2,'dos table'),(3,'t1');
SELECT * FROM t1;

CREATE TABLE t2 (
a INT NOT NULL,
message CHAR(10)) ENGINE=connect TABLE_TYPE=BIN;
INSERT INTO t2 VALUES (1,'Testing'),(2,NULL),(3,'t2');
SELECT * FROM t2;

CREATE TABLE t3 (
a INT NOT NULL,
message CHAR(10)) ENGINE=connect TABLE_TYPE=CSV;
INSERT INTO t3 VALUES (1,'Testing'),(2,'csv table'),(3,'t3');
SELECT * FROM t3;

CREATE TABLE t4 (
ta INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
message CHAR(20)) ENGINE=MyISAM;
INSERT INTO t4 (message) VALUES ('Testing'),('myisam table'),('t4');
SELECT * FROM t4;

--replace_result $PORT PORT
--eval CREATE TABLE total (tabname CHAR(8) NOT NULL SPECIAL='TABID', ta TINYINT NOT NULL FLAG=1, message CHAR(20)) engine=CONNECT table_type=TBL table_list='t1,t2,t3,t4' option_list='port=$PORT'

select * from total;
select * from total where tabname = 't2';
select * from total where tabname = 't2' and ta = 3;
select * from total where tabname in ('t1','t4');
select * from total where ta = 3 and tabname in ('t1','t2');
select * from total where tabname <> 't2';
select * from total where tabname != 't2' and ta = 3;
select * from total where tabname not in ('t2','t3');
select * from total where ta = 3 and tabname in ('t2','t3');
select * from total where ta = 3 or tabname in ('t2','t4');
select * from total where not tabname = 't2';
select * from total where tabname = 't2' or tabname = 't1';

DROP TABLE total;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
DROP TABLE t4;