diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2013-07-11 17:45:31 +0200 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2013-07-11 17:45:31 +0200 |
commit | 9492c7f15c8b45ebd2b811e2b92aa35f3c807b2c (patch) | |
tree | 9ffea2d85e485b6e93b1e25ef4e5ad908a5b30bd /storage/connect/mysql-test/connect/t/mysql.test | |
parent | d24e1fc82a13f4f1e12fdd8ee8fdce3d01bd1f1e (diff) | |
download | mariadb-git-9492c7f15c8b45ebd2b811e2b92aa35f3c807b2c.tar.gz |
- Applying temporary restrictions to test files.
This is to suppress some valgrind warnings and consist principally in:
1 - Not supporting connect_assisted_discovery to all PROXY based table types
2 - Not supporting the PIVOT table type
This temporarily until the valgrind errors/warnings are fixed
modified:
storage/connect/ha_connect.cc
storage/connect/mysql-test/connect/r/mysql.result
storage/connect/mysql-test/connect/r/pivot.result
storage/connect/mysql-test/connect/r/xcol.result
storage/connect/mysql-test/connect/t/mysql.test
storage/connect/mysql-test/connect/t/pivot.test
storage/connect/mysql-test/connect/t/xcol.test
Diffstat (limited to 'storage/connect/mysql-test/connect/t/mysql.test')
-rw-r--r-- | storage/connect/mysql-test/connect/t/mysql.test | 851 |
1 files changed, 431 insertions, 420 deletions
diff --git a/storage/connect/mysql-test/connect/t/mysql.test b/storage/connect/mysql-test/connect/t/mysql.test index c7eacbd3d06..9f8660467d9 100644 --- a/storage/connect/mysql-test/connect/t/mysql.test +++ b/storage/connect/mysql-test/connect/t/mysql.test @@ -1,420 +1,431 @@ --- source include/not_embedded.inc - -# -# TODO: consider a possibility to run this test -# against some remote MySQL server -# - -let $PORT= `select @@port`; - ---disable_query_log ---replace_result $PORT PORT ---error 0,ER_UNKNOWN_ERROR ---eval CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' -if (!`SELECT count(*) FROM INFORMATION_SCHEMA.TABLES - WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1' - AND ENGINE='CONNECT' - AND CREATE_OPTIONS LIKE '%`table_type`=MySQL%'`) -{ - Skip Need MySQL support; -} -DROP TABLE t1; ---enable_query_log - -# 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 -# Suppress "mysql_real_connect failed:" (printed in _DEBUG build) ---replace_result $PORT PORT "mysql_real_connect failed: " "" ---error ER_UNKNOWN_ERROR ---eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root1,port=$PORT' - -# Bad database name ---replace_result $PORT PORT "mysql_real_connect failed: " "" ---error ER_UNKNOWN_ERROR ---eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL DBNAME='unknown' TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT' - -# Bad database name, with OPTION_LIST going first. ---replace_result $PORT PORT "mysql_real_connect failed: " "" ---error ER_UNKNOWN_ERROR ---eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL OPTION_LIST='host=localhost,user=root,port=$PORT' DBNAME='unknown' TABNAME='t1' - -# 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' ---replace_result $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: remote NULL, local NOT NULL ---replace_result $PORT PORT ---eval CREATE TABLE t2 (a INT NOT NULL, b CHAR(10) NOT NULL) 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 - +-- source include/not_embedded.inc
+
+#
+# TODO: consider a possibility to run this test
+# against some remote MySQL server
+#
+
+let $PORT= `select @@port`;
+
+--disable_query_log
+--replace_result $PORT PORT
+--error 0,ER_UNKNOWN_ERROR
+--eval CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
+if (!`SELECT count(*) FROM INFORMATION_SCHEMA.TABLES
+ WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'
+ AND ENGINE='CONNECT'
+ AND CREATE_OPTIONS LIKE '%`table_type`=MySQL%'`)
+{
+ Skip Need MySQL support;
+}
+DROP TABLE t1;
+--enable_query_log
+
+# 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
+# Suppress "mysql_real_connect failed:" (printed in _DEBUG build)
+#--replace_result $PORT PORT "mysql_real_connect failed: " ""
+#--error ER_UNKNOWN_ERROR
+#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root1,port=$PORT'
+
+# Bad database name
+#--replace_result $PORT PORT "mysql_real_connect failed: " ""
+#--error ER_UNKNOWN_ERROR
+#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL DBNAME='unknown' TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
+
+# Bad database name, with OPTION_LIST going first.
+#--replace_result $PORT PORT "mysql_real_connect failed: " ""
+#--error ER_UNKNOWN_ERROR
+#--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL OPTION_LIST='host=localhost,user=root,port=$PORT' DBNAME='unknown' TABNAME='t1'
+
+# 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'
+--replace_result $PORT PORT
+--eval CREATE TABLE t2 (a 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
+--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'
+ALTER TABLE t1 RENAME t1backup;
+#--error ER_NO_SUCH_TABLE
+--error ER_GET_ERRMSG
+SELECT * FROM t2;
+ALTER TABLE t1backup RENAME t1;
+DROP TABLE t2;
+
+
+--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: remote NULL, local NOT NULL
+--replace_result $PORT PORT
+--eval CREATE TABLE t2 (a INT NOT NULL, b CHAR(10) NOT NULL) 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'
+--eval CREATE TABLE t2 (a smallint) 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'
+--eval CREATE TABLE t2 (a int) 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'
+--eval CREATE TABLE t2 (a int) 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'
+--eval CREATE TABLE t2 (a bigint) 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'
+--eval CREATE TABLE t2 (a varchar(10)) 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'
+--eval CREATE TABLE t2 (a varchar(10)) 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'
+--eval CREATE TABLE t2 (a date) 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
+
|