Commit b2f11bf0 authored by Alexander Barkov's avatar Alexander Barkov

Adding a new test: creating a TABLE_TYPE=CSV table from a MyISAM table using

  CREATE TABLE t2 ... AS SELECT * FROM t1;

modified:
  mysql-test/suite/connect/r/csv.result
  mysql-test/suite/connect/t/csv.test
parent 70e92c85
......@@ -124,3 +124,21 @@ REPLACE(LOAD_FILE('DATADIR/test/tmp.csv'),'\r\n','\n')
"4000","4000"
"a b","c d"
#
# Creating a CSV table from a MyISAM table
#
CREATE TABLE t1 (a VARCHAR(10), b INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('test1',1), ('test2',2);
CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t2.csv'
AS SELECT * FROM t1;
SELECT * FROM t2;
a b
test1 1
test2 2
DROP TABLE t2;
DROP TABLE t1;
SELECT REPLACE(LOAD_FILE('DATADIR/test/t2.csv'),'\r\n','\n');;
REPLACE(LOAD_FILE('DATADIR/test/t2.csv'),'\r\n','\n')
test1,1
test2,2
......@@ -79,6 +79,22 @@ DROP TABLE t1;
--replace_result $MYSQLD_DATADIR DATADIR
--eval SELECT REPLACE(LOAD_FILE('$MYSQLD_DATADIR/test/tmp.csv'),'\r\n','\n');
--echo #
--echo # Creating a CSV table from a MyISAM table
--echo #
CREATE TABLE t1 (a VARCHAR(10), b INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('test1',1), ('test2',2);
CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t2.csv'
AS SELECT * FROM t1;
SELECT * FROM t2;
DROP TABLE t2;
DROP TABLE t1;
--chmod 0777 $MYSQLD_DATADIR/test/t2.csv
--replace_result $MYSQLD_DATADIR DATADIR
--eval SELECT REPLACE(LOAD_FILE('$MYSQLD_DATADIR/test/t2.csv'),'\r\n','\n');
--remove_file $MYSQLD_DATADIR/test/t2.csv
#
# Clean up
#
......
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