Commit b0c378b4 authored by Olivier Bertrand's avatar Olivier Bertrand

- Add a test case for multiple tables

added:
  storage/connect/mysql-test/connect/r/mul.result
  storage/connect/mysql-test/connect/t/mul.test
parent d861b617
#
# Testing multiple 1
#
CREATE TABLE `t1` (
`a` char(10) DEFAULT NULL,
`b` char(10) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `table_type`=CSV `sep_char`=';';
Warnings:
Warning 1105 No file name. Table will use t1.csv
INSERT INTO t1 VALUES('test1','bla');
SELECT * FROM t1;
a b
test1 bla
CREATE TABLE `t2` (
`a` char(10) DEFAULT NULL,
`b` char(10) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `table_type`=CSV `sep_char`=';';
Warnings:
Warning 1105 No file name. Table will use t2.csv
INSERT INTO t2 VALUES('test2','blub');
SELECT * FROM t2;
a b
test2 blub
CREATE TABLE `t_all` (
`a` char(10) DEFAULT NULL,
`b` char(10) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `table_type`=CSV `file_name`='t*.csv' `sep_char`=';' `multiple`=1;
SELECT * FROM t_all;
a b
test1 bla
test2 blub
#
# Testing multiple 2
#
CREATE table fnlist (
fn char(8) not null
) ENGINE=CONNECT DEFAULT CHARSET=latin1 table_type=DOS;
Warnings:
Warning 1105 No file name. Table will use fnlist.dos
INSERT INTO fnlist VALUES('t1.csv'),('t2.csv');
SELECT fn FROM fnlist;
fn
t1.csv
t2.csv
CREATE TABLE `tblist` (
`a` char(10) DEFAULT NULL,
`b` char(10) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `table_type`=CSV `file_name`='fnlist.dos' `sep_char`=';' `multiple`=2;
SELECT * FROM tblist;
a b
test1 bla
test2 blub
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t_all;
DROP TABLE fnlist;
DROP TABLE tblist;
--echo #
--echo # Testing multiple 1
--echo #
CREATE TABLE `t1` (
`a` char(10) DEFAULT NULL,
`b` char(10) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `table_type`=CSV `sep_char`=';';
INSERT INTO t1 VALUES('test1','bla');
SELECT * FROM t1;
CREATE TABLE `t2` (
`a` char(10) DEFAULT NULL,
`b` char(10) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `table_type`=CSV `sep_char`=';';
INSERT INTO t2 VALUES('test2','blub');
SELECT * FROM t2;
CREATE TABLE `t_all` (
`a` char(10) DEFAULT NULL,
`b` char(10) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `table_type`=CSV `file_name`='t*.csv' `sep_char`=';' `multiple`=1;
SELECT * FROM t_all;
--echo #
--echo # Testing multiple 2
--echo #
CREATE table fnlist (
fn char(8) not null
) ENGINE=CONNECT DEFAULT CHARSET=latin1 table_type=DOS;
INSERT INTO fnlist VALUES('t1.csv'),('t2.csv');
SELECT fn FROM fnlist;
CREATE TABLE `tblist` (
`a` char(10) DEFAULT NULL,
`b` char(10) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `table_type`=CSV `file_name`='fnlist.dos' `sep_char`=';' `multiple`=2;
SELECT * FROM tblist;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t_all;
DROP TABLE fnlist;
DROP TABLE tblist;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment