Commit 0a280eb8 authored by Olivier Bertrand's avatar Olivier Bertrand

- Commiting merges

  Simplify update in pre_create

modified:
  mysql-test/suite/connect/r/mysql.result
  mysql-test/suite/connect/t/mysql.test
  mysql-test/suite/connect/t/xml.test
  storage/connect/CMakeLists.txt
  storage/connect/ha_connect.cc
  storage/connect/mycat.cc
parents 553964dc aa92de5a
...@@ -12,6 +12,10 @@ NULL NULL ...@@ -12,6 +12,10 @@ NULL NULL
# #
CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root1,port=PORT'; 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) ERROR HY000: (1045) Access denied for user 'root1'@'localhost' (using password: NO)
CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL DBNAME='unknown' TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=PORT';
ERROR HY000: (1049) Unknown database 'unknown'
CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL OPTION_LIST='host=localhost,user=root,port=PORT' DBNAME='unknown' TABNAME='t1';
ERROR HY000: (1049) Unknown database 'unknown'
CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='unknown' OPTION_LIST='host=localhost,user=root,port=PORT'; 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] ERROR HY000: (1146) Table 'test.unknown' doesn't exist [SHOW FULL COLUMNS FROM unknown FROM test]
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
...@@ -127,6 +131,21 @@ t2 CREATE TABLE `t2` ( ...@@ -127,6 +131,21 @@ t2 CREATE TABLE `t2` (
SELECT * FROM t2; SELECT * FROM t2;
a a
DROP TABLE t2, t1; DROP TABLE t2, t1;
CREATE TABLE t1 (a bigint);
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` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` bigint(20) 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 # Testing character data types
# #
......
...@@ -17,7 +17,15 @@ SELECT * FROM t1; ...@@ -17,7 +17,15 @@ SELECT * FROM t1;
--error ER_UNKNOWN_ERROR --error ER_UNKNOWN_ERROR
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root1,port=$PORT' --eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root1,port=$PORT'
# TODO: bad database name # 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 # Bad table name
--replace_result $PORT PORT --replace_result $PORT PORT
...@@ -132,15 +140,15 @@ DROP TABLE t2, t1; ...@@ -132,15 +140,15 @@ DROP TABLE t2, t1;
# TODO: bigint is mapped to double(20,0) # TODO: bigint is mapped to double(20,0)
#CREATE TABLE t1 (a bigint); CREATE TABLE t1 (a bigint);
#--replace_result $PORT PORT --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 ENGINE=CONNECT TABLE_TYPE=MYSQL TABNAME='t1' OPTION_LIST='host=localhost,user=root,port=$PORT'
#--replace_result $PORT PORT --replace_result $PORT PORT
#SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
#--replace_result $PORT PORT --replace_result $PORT PORT
#SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
#SELECT * FROM t2; SELECT * FROM t2;
#DROP TABLE t2, t1; DROP TABLE t2, t1;
# TODO: ERROR 1439: Display width out of range for 'a' (max = 255) # TODO: ERROR 1439: Display width out of range for 'a' (max = 255)
......
...@@ -5,6 +5,7 @@ ENGINE=CONNECT TABLE_TYPE=XML OPTION_LIST='xmlsup=libxml2'; ...@@ -5,6 +5,7 @@ ENGINE=CONNECT TABLE_TYPE=XML OPTION_LIST='xmlsup=libxml2';
if (!`SELECT count(*) FROM INFORMATION_SCHEMA.TABLES if (!`SELECT count(*) FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1' WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'
AND ENGINE='CONNECT' AND ENGINE='CONNECT'
AND CREATE_OPTIONS LIKE '%`table_type`=XML%'
AND CREATE_OPTIONS LIKE '%xmlsup=libxml2%'`) AND CREATE_OPTIONS LIKE '%xmlsup=libxml2%'`)
{ {
Skip Need LIBXML2; Skip Need LIBXML2;
......
...@@ -86,6 +86,10 @@ OPTION(CONNECT_WITH_LIBXML2 "Compile CONNECT storage engine with LIBXML2 support ...@@ -86,6 +86,10 @@ OPTION(CONNECT_WITH_LIBXML2 "Compile CONNECT storage engine with LIBXML2 support
IF(CONNECT_WITH_LIBXML2) IF(CONNECT_WITH_LIBXML2)
IF(WIN32) IF(WIN32)
#
# NOTE: when switching to static linking of libxml2
# make sure to define LIBXML_STATIC.
#
# Adding some typical places to search in # Adding some typical places to search in
SET(PC_LIBXML_INCLUDE_DIRS SET(PC_LIBXML_INCLUDE_DIRS
C:/libxml2/include C:/libxml2/include
......
...@@ -3378,7 +3378,8 @@ bool ha_connect::pre_create(THD *thd, HA_CREATE_INFO *create_info, ...@@ -3378,7 +3378,8 @@ bool ha_connect::pre_create(THD *thd, HA_CREATE_INFO *create_info,
} else if (!stricmp(pov->name.str, "option_list")) { } else if (!stricmp(pov->name.str, "option_list")) {
host= GetListOption("host", pov->value.str, "localhost"); host= GetListOption("host", pov->value.str, "localhost");
user= GetListOption("user", pov->value.str, "root"); user= GetListOption("user", pov->value.str, "root");
db= GetListOption("database", pov->value.str); // Default value db can come from the DBNAME=xxx option.
db= GetListOption("database", pov->value.str, db);
pwd= GetListOption("password", pov->value.str); pwd= GetListOption("password", pov->value.str);
prt= GetListOption("port", pov->value.str); prt= GetListOption("port", pov->value.str);
port= (prt) ? atoi(prt) : MYSQL_PORT; port= (prt) ? atoi(prt) : MYSQL_PORT;
......
...@@ -107,10 +107,14 @@ TABTYPE GetTypeID(const char *type) ...@@ -107,10 +107,14 @@ TABTYPE GetTypeID(const char *type)
: (!stricmp(type, "CSV")) ? TAB_CSV : (!stricmp(type, "CSV")) ? TAB_CSV
: (!stricmp(type, "FMT")) ? TAB_FMT : (!stricmp(type, "FMT")) ? TAB_FMT
: (!stricmp(type, "DBF")) ? TAB_DBF : (!stricmp(type, "DBF")) ? TAB_DBF
#ifdef XML_SUPPORT
: (!stricmp(type, "XML")) ? TAB_XML : (!stricmp(type, "XML")) ? TAB_XML
#endif
: (!stricmp(type, "INI")) ? TAB_INI : (!stricmp(type, "INI")) ? TAB_INI
: (!stricmp(type, "VEC")) ? TAB_VEC : (!stricmp(type, "VEC")) ? TAB_VEC
#ifdef ODBC_SUPPORT
: (!stricmp(type, "ODBC")) ? TAB_ODBC : (!stricmp(type, "ODBC")) ? TAB_ODBC
#endif
: (!stricmp(type, "MYSQL")) ? TAB_MYSQL : (!stricmp(type, "MYSQL")) ? TAB_MYSQL
: (!stricmp(type, "DIR")) ? TAB_DIR : (!stricmp(type, "DIR")) ? TAB_DIR
: (!stricmp(type, "MAC")) ? TAB_MAC : (!stricmp(type, "MAC")) ? TAB_MAC
......
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