From b0376d1e16d15046c65617180b4c39775548918e Mon Sep 17 00:00:00 2001 From: Alexander Barkov <bar@mnogosearch.org> Date: Thu, 21 Feb 2013 13:49:47 +0400 Subject: [PATCH] Adding tests for TABLE_TYPE=MySQL added: mysql-test/suite/connect/r/mysql.result mysql-test/suite/connect/t/mysql.test --- mysql-test/suite/connect/r/mysql.result | 183 ++++++++++++ mysql-test/suite/connect/t/mysql.test | 381 ++++++++++++++++++++++++ 2 files changed, 564 insertions(+) create mode 100644 mysql-test/suite/connect/r/mysql.result create mode 100644 mysql-test/suite/connect/t/mysql.test diff --git a/mysql-test/suite/connect/r/mysql.result b/mysql-test/suite/connect/r/mysql.result new file mode 100644 index 0000000000..8a17b721ff --- /dev/null +++ b/mysql-test/suite/connect/r/mysql.result @@ -0,0 +1,183 @@ +CREATE TABLE t1 (a int, b char(10)); +INSERT INTO t1 VALUES (NULL,NULL),(0,'test00'),(1,'test01'),(2,'test02'),(3,'test03'); +SELECT * FROM t1; +a b +NULL NULL +0 test00 +1 test01 +2 test02 +3 test03 +# +# Testing errors +# +CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root1,port=PORT'; +ERROR HY000: (1045) Access denied for user 'root1'@'localhost' (using password: NO) +CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='unknown' OPTION_LIST='host=localhost,user=root,port=PORT'; +ERROR HY000: (1146) Table 'test.unknown' doesn't exist [SHOW FULL COLUMNS FROM unknown FROM test] +SHOW CREATE TABLE t2; +ERROR 42S02: Table 'test.t2' doesn't exist +CREATE TABLE t2 (x int, y char(10)) ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=PORT'; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `x` int(11) DEFAULT NULL, + `y` char(10) DEFAULT NULL +) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=MYSQL `TABNAME`='t1' `OPTION_LIST`='host=localhost,user=root,port=16000' +SELECT * FROM t2; +ERROR HY000: Got error 174 '(1054) Unknown column 'x' in 'field list' [SELECT `x`, `y` FROM `t1`]' from CONNECT +DROP TABLE t2; +ALTER TABLE t1 RENAME t1backup; +SELECT * FROM t2; +ERROR 42S02: Table 'test.t2' doesn't exist +ALTER TABLE t1backup RENAME t1; +# +# Testing SELECT, etc. +# +CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=PORT'; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL +) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=MYSQL `TABNAME`='t1' `OPTION_LIST`='host=localhost,user=root,port=PORT' +SELECT * FROM t2; +a b +0 +0 test00 +1 test01 +2 test02 +3 test03 +DROP TABLE t2; +CREATE TABLE t2 (a int, b char(10)) ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=PORT'; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` char(10) DEFAULT NULL +) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=MYSQL `TABNAME`='t1' `OPTION_LIST`='host=localhost,user=root,port=PORT' +SELECT * FROM t2; +a b +0 +0 test00 +1 test01 +2 test02 +3 test03 +DROP TABLE t2; +CREATE TABLE t2 (a char(10), b int) ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=PORT'; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` char(10) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=MYSQL `TABNAME`='t1' `OPTION_LIST`='host=localhost,user=root,port=PORT' +SELECT * FROM t2; +a b + 0 +0 0 +1 0 +2 0 +3 0 +DROP TABLE t2; +DROP TABLE t1; +# +# Testing numeric data types +# +CREATE TABLE t1 (a smallint); +CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=PORT'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` smallint(6) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` smallint(6) DEFAULT NULL +) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=MYSQL `TABNAME`='t1' `OPTION_LIST`='host=localhost,user=root,port=PORT' +SELECT * FROM t2; +a +DROP TABLE t2, t1; +CREATE TABLE t1 (a mediumint); +CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=PORT'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` mediumint(9) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(9) DEFAULT NULL +) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=MYSQL `TABNAME`='t1' `OPTION_LIST`='host=localhost,user=root,port=PORT' +SELECT * FROM t2; +a +DROP TABLE t2, t1; +CREATE TABLE t1 (a int); +CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=PORT'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL +) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=MYSQL `TABNAME`='t1' `OPTION_LIST`='host=localhost,user=root,port=PORT' +SELECT * FROM t2; +a +DROP TABLE t2, t1; +# +# Testing character data types +# +CREATE TABLE t1 (a char(10)); +CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=PORT'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` varchar(10) DEFAULT NULL +) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=MYSQL `TABNAME`='t1' `OPTION_LIST`='host=localhost,user=root,port=PORT' +SELECT * FROM t2; +a +DROP TABLE t2, t1; +CREATE TABLE t1 (a varchar(10)); +CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=PORT'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` varchar(10) DEFAULT NULL +) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=MYSQL `TABNAME`='t1' `OPTION_LIST`='host=localhost,user=root,port=PORT' +SELECT * FROM t2; +a +DROP TABLE t2, t1; +# +# Testing binary data types +# +# +# Testing temporal data types +# +CREATE TABLE t1 (a date); +CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=PORT'; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` date DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` date DEFAULT NULL +) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=MYSQL `TABNAME`='t1' `OPTION_LIST`='host=localhost,user=root,port=PORT' +SELECT * FROM t2; +a +DROP TABLE t2, t1; diff --git a/mysql-test/suite/connect/t/mysql.test b/mysql-test/suite/connect/t/mysql.test new file mode 100644 index 0000000000..357296731d --- /dev/null +++ b/mysql-test/suite/connect/t/mysql.test @@ -0,0 +1,381 @@ +let $PORT= `select @@port`; + +# TODO: NULLs do not work +# TODO: remote VARCHAR is displayed as CHAR + +CREATE TABLE t1 (a int, b char(10)); +INSERT INTO t1 VALUES (NULL,NULL),(0,'test00'),(1,'test01'),(2,'test02'),(3,'test03'); +SELECT * FROM t1; + +--echo # +--echo # Testing errors +--echo # + +# Bad user name +--replace_result $PORT PORT +--error ER_UNKNOWN_ERROR +--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root1,port=$PORT' + +# TODO: bad database name + +# Bad table name +--replace_result $PORT PORT +--error ER_UNKNOWN_ERROR +--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='unknown' OPTION_LIST='host=localhost,user=root,port=$PORT' +--error ER_NO_SUCH_TABLE +SHOW CREATE TABLE t2; + +# Bad column name +--replace_result $PORT PORT +--eval CREATE TABLE t2 (x int, y char(10)) ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +SHOW CREATE TABLE t2; +--error ER_GET_ERRMSG +SELECT * FROM t2; +DROP TABLE t2; + +# The remote table disappeared +ALTER TABLE t1 RENAME t1backup; +--error ER_NO_SUCH_TABLE +SELECT * FROM t2; +ALTER TABLE t1backup RENAME t1; + + + +--echo # +--echo # Testing SELECT, etc. +--echo # + +# Automatic table structure +--replace_result $PORT PORT +--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +--replace_result $PORT PORT +SHOW CREATE TABLE t2; +SELECT * FROM t2; +DROP TABLE t2; + + +# Explicit table structure +--replace_result $PORT PORT +--eval CREATE TABLE t2 (a int, b char(10)) ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +--replace_result $PORT PORT +SHOW CREATE TABLE t2; +SELECT * FROM t2; +DROP TABLE t2; + + +# Explicit table structure with wrong column types +--replace_result $PORT PORT +--eval CREATE TABLE t2 (a char(10), b int) ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +--replace_result $PORT PORT +SHOW CREATE TABLE t2; +SELECT * FROM t2; +DROP TABLE t2; + +DROP TABLE t1; + +--echo # +--echo # Testing numeric data types +--echo # + +# TODO: tinyint is mapped to smallint +#CREATE TABLE t1 (a tinyint); +#--replace_result $PORT PORT +#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +#--replace_result $PORT PORT +#SHOW CREATE TABLE t1; +#--replace_result $PORT PORT +#SHOW CREATE TABLE t2; +#SELECT * FROM t2; +#DROP TABLE t2, t1; + +# TODO: unsigned does not work +#CREATE TABLE t1 (a tinyint unsigned); +#--replace_result $PORT PORT +#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +#SHOW CREATE TABLE t1; +#--replace_result $PORT PORT +#SHOW CREATE TABLE t2; +#SELECT * FROM t2; +#DROP TABLE t2, t1; + +CREATE TABLE t1 (a smallint); +--replace_result $PORT PORT +--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +--replace_result $PORT PORT +SHOW CREATE TABLE t1; +--replace_result $PORT PORT +SHOW CREATE TABLE t2; +SELECT * FROM t2; +DROP TABLE t2, t1; + +CREATE TABLE t1 (a mediumint); +--replace_result $PORT PORT +--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +--replace_result $PORT PORT +SHOW CREATE TABLE t1; +--replace_result $PORT PORT +SHOW CREATE TABLE t2; +SELECT * FROM t2; +DROP TABLE t2, t1; + +CREATE TABLE t1 (a int); +--replace_result $PORT PORT +--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +--replace_result $PORT PORT +SHOW CREATE TABLE t1; +--replace_result $PORT PORT +SHOW CREATE TABLE t2; +SELECT * FROM t2; +DROP TABLE t2, t1; + + +# TODO: bigint is mapped to double(20,0) +#CREATE TABLE t1 (a bigint); +#--replace_result $PORT PORT +#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +#--replace_result $PORT PORT +#SHOW CREATE TABLE t1; +#--replace_result $PORT PORT +#SHOW CREATE TABLE t2; +#SELECT * FROM t2; +#DROP TABLE t2, t1; + + +# TODO: ERROR 1439: Display width out of range for 'a' (max = 255) +#CREATE TABLE t1 (a float); +#--replace_result $PORT PORT +#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +#--replace_result $PORT PORT +#SHOW CREATE TABLE t1; +#--replace_result $PORT PORT +#SHOW CREATE TABLE t2; +#SELECT * FROM t2; +#DROP TABLE t2, t1; + +# TODO: ERROR 1439: Display width out of range for 'a' (max = 255) +#CREATE TABLE t1 (a double); +#--replace_result $PORT PORT +#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +#--replace_result $PORT PORT +#SHOW CREATE TABLE t1; +#--replace_result $PORT PORT +#SHOW CREATE TABLE t2; +#SELECT * FROM t2; +#DROP TABLE t2, t1; + +# TODO: decimal is converted to double +#CREATE TABLE t1 (a decimal(20,5)); +#--replace_result $PORT PORT +#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +#--replace_result $PORT PORT +#SHOW CREATE TABLE t1; +#--replace_result $PORT PORT +#SHOW CREATE TABLE t2; +#SELECT * FROM t2; +#DROP TABLE t2, t1; + +# TODO: add test for BIT + +--echo # +--echo # Testing character data types +--echo # + +# TODO: char is mapped to varchar +CREATE TABLE t1 (a char(10)); +--replace_result $PORT PORT +--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +--replace_result $PORT PORT +SHOW CREATE TABLE t1; +--replace_result $PORT PORT +SHOW CREATE TABLE t2; +SELECT * FROM t2; +DROP TABLE t2, t1; + +CREATE TABLE t1 (a varchar(10)); +--replace_result $PORT PORT +--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +--replace_result $PORT PORT +SHOW CREATE TABLE t1; +--replace_result $PORT PORT +SHOW CREATE TABLE t2; +SELECT * FROM t2; +DROP TABLE t2, t1; + +# TODO: ERROR 1105: Unsupported column type tinytext +#CREATE TABLE t1 (a tinytext); +#--replace_result $PORT PORT +#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +#--replace_result $PORT PORT +#SHOW CREATE TABLE t1; +#--replace_result $PORT PORT +#SHOW CREATE TABLE t2; +#SELECT * FROM t2; +#DROP TABLE t2, t1; + +# TODO: ERROR 1105: Unsupported column type mediumtext +#CREATE TABLE t1 (a mediumtext); +#--replace_result $PORT PORT +#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +#--replace_result $PORT PORT +#SHOW CREATE TABLE t1; +#--replace_result $PORT PORT +#SHOW CREATE TABLE t2; +#SELECT * FROM t2; +#DROP TABLE t2, t1; + +# TODO: text is converted to varchar(256) +#CREATE TABLE t1 (a text); +#--replace_result $PORT PORT +#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +#--replace_result $PORT PORT +#SHOW CREATE TABLE t1; +#--replace_result $PORT PORT +#SHOW CREATE TABLE t2; +#SELECT * FROM t2; +#DROP TABLE t2, t1; + +# TODO: ERROR 1105: Unsupported column type longtext +#CREATE TABLE t1 (a longtext); +#--replace_result $PORT PORT +#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +#--replace_result $PORT PORT +#SHOW CREATE TABLE t1; +#--replace_result $PORT PORT +#SHOW CREATE TABLE t2; +#SELECT * FROM t2; +#DROP TABLE t2, t1; + +#TODO: add tests for ENUM +#TODO: add tests for SET + +--echo # +--echo # Testing binary data types +--echo # + +# TODO: ERROR 1105: Unsupported column type binary +#CREATE TABLE t1 (a binary(10)); +#--replace_result $PORT PORT +#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +#--replace_result $PORT PORT +#SHOW CREATE TABLE t1; +#--replace_result $PORT PORT +#SHOW CREATE TABLE t2; +#SELECT * FROM t2; +#DROP TABLE t2, t1; + +# TODO: ERROR 1105: Unsupported column type varbinary +#CREATE TABLE t1 (a varbinary(10)); +#--replace_result $PORT PORT +#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +#--replace_result $PORT PORT +#SHOW CREATE TABLE t1; +#--replace_result $PORT PORT +#SHOW CREATE TABLE t2; +#SELECT * FROM t2; +#DROP TABLE t2, t1; + +# TODO: ERROR 1105: Unsupported column type tinyblob +#CREATE TABLE t1 (a tinyblob); +#--replace_result $PORT PORT +#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +#--replace_result $PORT PORT +#SHOW CREATE TABLE t1; +#--replace_result $PORT PORT +#SHOW CREATE TABLE t2; +#SELECT * FROM t2; +#DROP TABLE t2, t1; + +# TODO: ERROR 1105: Unsupported column type mediumblob +#CREATE TABLE t1 (a mediumblob); +#--replace_result $PORT PORT +#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +#--replace_result $PORT PORT +#SHOW CREATE TABLE t1; +#--replace_result $PORT PORT +#SHOW CREATE TABLE t2; +#SELECT * FROM t2; +#DROP TABLE t2, t1; + +# TODO: blob is converted to varchar(256) +#CREATE TABLE t1 (a blob); +#--replace_result $PORT PORT +#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +#--replace_result $PORT PORT +#SHOW CREATE TABLE t1; +#--replace_result $PORT PORT +#SHOW CREATE TABLE t2; +#SELECT * FROM t2; +#DROP TABLE t2, t1; + +# TODO: ERROR 1105: Unsupported column type longblob +#CREATE TABLE t1 (a longblob); +#--replace_result $PORT PORT +#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +#--replace_result $PORT PORT +#SHOW CREATE TABLE t1; +#--replace_result $PORT PORT +#SHOW CREATE TABLE t2; +#SELECT * FROM t2; +#DROP TABLE t2, t1; + +# TODO: ERROR 1105: Unsupported column type geometry +#CREATE TABLE t1 (a geometry); +#--replace_result $PORT PORT +#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +#--replace_result $PORT PORT +#SHOW CREATE TABLE t1; +#--replace_result $PORT PORT +#SHOW CREATE TABLE t2; +#SELECT * FROM t2; +#DROP TABLE t2, t1; + +--echo # +--echo # Testing temporal data types +--echo # + +# TODO: time is converted to date +#CREATE TABLE t1 (a time); +#--replace_result $PORT PORT +#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +#--replace_result $PORT PORT +#SHOW CREATE TABLE t1; +#--replace_result $PORT PORT +#SHOW CREATE TABLE t2; +#SELECT * FROM t2; +#DROP TABLE t2, t1; + +CREATE TABLE t1 (a date); +--replace_result $PORT PORT +--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +--replace_result $PORT PORT +SHOW CREATE TABLE t1; +--replace_result $PORT PORT +SHOW CREATE TABLE t2; +SELECT * FROM t2; +DROP TABLE t2, t1; + +# TODO: datetime is converted to date +#CREATE TABLE t1 (a datetime); +#--replace_result $PORT PORT +#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +#--replace_result $PORT PORT +#SHOW CREATE TABLE t1; +#--replace_result $PORT PORT +#SHOW CREATE TABLE t2; +#SELECT * FROM t2; +#DROP TABLE t2, t1; + +# TODO: timestamp is converted to date +#CREATE TABLE t1 (a timestamp); +#--replace_result $PORT PORT +#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' +#--replace_result $PORT PORT +#SHOW CREATE TABLE t1; +#--replace_result $PORT PORT +#SHOW CREATE TABLE t2; +#SELECT * FROM t2; +#DROP TABLE t2, t1; + +# TODO: add test for YEAR +# TODO: add tests for fractional seconds + -- 2.30.9