mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
- Commit added test on TBL tables
+ update dbf.result added: mysql-test/suite/connect/r/tbl.result mysql-test/suite/connect/t/tbl.test modified: mysql-test/suite/connect/r/dbf.result - Fix bug on generating default file name for TBL sub-tables modified: storage/connect/ha_connect.cc
This commit is contained in:
@ -639,8 +639,6 @@ Dec 0
|
||||
Flags 00
|
||||
-------- --------
|
||||
ALTER TABLE t1 MODIFY a INT(10) NOT NULL;
|
||||
Warnings:
|
||||
Warning 1366 Incorrect integer value: '' for column 'a' at row 1
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
|
123
mysql-test/suite/connect/r/tbl.result
Normal file
123
mysql-test/suite/connect/r/tbl.result
Normal file
@ -0,0 +1,123 @@
|
||||
#
|
||||
# Checking TBL tables
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
a INT NOT NULL,
|
||||
message CHAR(10) NOT NULL) ENGINE=connect;
|
||||
Warnings:
|
||||
Warning 1105 No table_type. Was set to DOS
|
||||
Warning 1105 No file name. Table will use t1.dos
|
||||
INSERT INTO t1 VALUES (1,'Testing'),(2,'dos table'),(3,'t1');
|
||||
SELECT * FROM t1;
|
||||
a message
|
||||
1 Testing
|
||||
2 dos table
|
||||
3 t1
|
||||
CREATE TABLE t2 (
|
||||
a INT NOT NULL,
|
||||
message CHAR(10) NOT NULL) ENGINE=connect TABLE_TYPE=BIN;
|
||||
Warnings:
|
||||
Warning 1105 No file name. Table will use t2.bin
|
||||
INSERT INTO t2 VALUES (1,'Testing'),(2,'bin table'),(3,'t2');
|
||||
SELECT * FROM t2;
|
||||
a message
|
||||
1 Testing
|
||||
2 bin table
|
||||
3 t2
|
||||
CREATE TABLE t3 (
|
||||
a INT NOT NULL,
|
||||
message CHAR(10) NOT NULL) ENGINE=connect TABLE_TYPE=CSV;
|
||||
Warnings:
|
||||
Warning 1105 No file name. Table will use t3.csv
|
||||
INSERT INTO t3 VALUES (1,'Testing'),(2,'csv table'),(3,'t3');
|
||||
SELECT * FROM t3;
|
||||
a message
|
||||
1 Testing
|
||||
2 csv table
|
||||
3 t3
|
||||
CREATE TABLE total (
|
||||
tabname CHAR(8) NOT NULL SPECIAL='TABID',
|
||||
ta TINYINT NOT NULL FLAG=1,
|
||||
message CHAR(20) NOT NULL)
|
||||
engine=CONNECT table_type=TBL table_list='t1,t2,t3';
|
||||
select * from total;
|
||||
tabname ta message
|
||||
t1 1 Testing
|
||||
t1 2 dos table
|
||||
t1 3 t1
|
||||
t2 1 Testing
|
||||
t2 2 bin table
|
||||
t2 3 t2
|
||||
t3 1 Testing
|
||||
t3 2 csv table
|
||||
t3 3 t3
|
||||
select * from total where tabname = 't2';
|
||||
tabname ta message
|
||||
t2 1 Testing
|
||||
t2 2 bin table
|
||||
t2 3 t2
|
||||
select * from total where tabname = 't2' and ta = 3;
|
||||
tabname ta message
|
||||
t2 3 t2
|
||||
select * from total where tabname in ('t1','t3');
|
||||
tabname ta message
|
||||
t1 1 Testing
|
||||
t1 2 dos table
|
||||
t1 3 t1
|
||||
t3 1 Testing
|
||||
t3 2 csv table
|
||||
t3 3 t3
|
||||
select * from total where ta = 3 and tabname in ('t1','t2');
|
||||
tabname ta message
|
||||
t1 3 t1
|
||||
t2 3 t2
|
||||
select * from total where tabname <> 't2';
|
||||
tabname ta message
|
||||
t1 1 Testing
|
||||
t1 2 dos table
|
||||
t1 3 t1
|
||||
t3 1 Testing
|
||||
t3 2 csv table
|
||||
t3 3 t3
|
||||
select * from total where tabname != 't2' and ta = 3;
|
||||
tabname ta message
|
||||
t1 3 t1
|
||||
t3 3 t3
|
||||
select * from total where tabname not in ('t2','t3');
|
||||
tabname ta message
|
||||
t1 1 Testing
|
||||
t1 2 dos table
|
||||
t1 3 t1
|
||||
select * from total where ta = 3 and tabname in ('t2','t3');
|
||||
tabname ta message
|
||||
t2 3 t2
|
||||
t3 3 t3
|
||||
select * from total where ta = 3 or tabname in ('t2','t3');
|
||||
tabname ta message
|
||||
t1 3 t1
|
||||
t2 1 Testing
|
||||
t2 2 bin table
|
||||
t2 3 t2
|
||||
t3 1 Testing
|
||||
t3 2 csv table
|
||||
t3 3 t3
|
||||
select * from total where not tabname = 't2';
|
||||
tabname ta message
|
||||
t1 1 Testing
|
||||
t1 2 dos table
|
||||
t1 3 t1
|
||||
t3 1 Testing
|
||||
t3 2 csv table
|
||||
t3 3 t3
|
||||
select * from total where tabname = 't2' or tabname = 't1';
|
||||
tabname ta message
|
||||
t1 1 Testing
|
||||
t1 2 dos table
|
||||
t1 3 t1
|
||||
t2 1 Testing
|
||||
t2 2 bin table
|
||||
t2 3 t2
|
||||
DROP TABLE total;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t3;
|
46
mysql-test/suite/connect/t/tbl.test
Normal file
46
mysql-test/suite/connect/t/tbl.test
Normal file
@ -0,0 +1,46 @@
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
--echo #
|
||||
--echo # Checking TBL tables
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
a INT NOT NULL,
|
||||
message CHAR(10) NOT NULL) 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) NOT NULL) ENGINE=connect TABLE_TYPE=BIN;
|
||||
INSERT INTO t2 VALUES (1,'Testing'),(2,'bin table'),(3,'t2');
|
||||
SELECT * FROM t2;
|
||||
|
||||
CREATE TABLE t3 (
|
||||
a INT NOT NULL,
|
||||
message CHAR(10) NOT NULL) ENGINE=connect TABLE_TYPE=CSV;
|
||||
INSERT INTO t3 VALUES (1,'Testing'),(2,'csv table'),(3,'t3');
|
||||
SELECT * FROM t3;
|
||||
|
||||
CREATE TABLE total (
|
||||
tabname CHAR(8) NOT NULL SPECIAL='TABID',
|
||||
ta TINYINT NOT NULL FLAG=1,
|
||||
message CHAR(20) NOT NULL)
|
||||
engine=CONNECT table_type=TBL table_list='t1,t2,t3';
|
||||
|
||||
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','t3');
|
||||
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','t3');
|
||||
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;
|
Reference in New Issue
Block a user