diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2019-07-26 07:57:57 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2019-07-26 07:57:57 +0200 |
commit | 25d216dcd53fed718a74792b3b36763749212ba9 (patch) | |
tree | 25089de9a4b7a5f841c2bb35b68699f784f392ac | |
parent | 584d213235704113cf0d70319c0521d93b8744c6 (diff) | |
parent | fe718541573d6a18a83901a8be23512d200a3206 (diff) | |
download | mariadb-git-25d216dcd53fed718a74792b3b36763749212ba9.tar.gz |
Merge remote-tracking branch 'connect/10.1' into 10.1
-rw-r--r-- | storage/connect/CMakeLists.txt | 9 | ||||
-rw-r--r-- | storage/connect/filter.cpp | 83 | ||||
-rw-r--r-- | storage/connect/ha_connect.cc | 2 | ||||
-rw-r--r-- | storage/connect/jdbconn.cpp | 56 | ||||
-rw-r--r-- | storage/connect/mycat.cc | 4 | ||||
-rw-r--r-- | storage/connect/mysql-test/connect/disabled.def | 24 | ||||
-rw-r--r-- | storage/connect/mysql-test/connect/r/jdbc.result | 12 | ||||
-rw-r--r-- | storage/connect/mysql-test/connect/r/json_java_2.result | 3 | ||||
-rw-r--r-- | storage/connect/mysql-test/connect/r/tbl_thread.result | 13 |
9 files changed, 82 insertions, 124 deletions
diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt index 0493e05a810..1d98d321486 100644 --- a/storage/connect/CMakeLists.txt +++ b/storage/connect/CMakeLists.txt @@ -114,6 +114,7 @@ IF(CONNECT_WITH_LIBXML2) FIND_PACKAGE(LibXml2) IF (LIBXML2_FOUND) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) + SET(ZLIB_LIBRARY "z") # see ZLIB_INCLUDE_DIR below SET(XML_LIBRARY ${LIBXML2_LIBRARIES}) SET(CONNECT_SOURCES ${CONNECT_SOURCES} libdoc.cpp libdoc.h) add_definitions(-DLIBXML2_SUPPORT) @@ -332,6 +333,14 @@ IF(NOT TARGET connect) RETURN() ENDIF() +# Don't link with bundled zlib and systel libxml2 at the same time. +# System libxml2 uses system zlib, might conflict with the bundled one. +IF (XML_LIBRARY AND BUILD_BUNDLED_ZLIB) + GET_PROPERTY(INCS TARGET connect PROPERTY INCLUDE_DIRECTORIES) + LIST(REMOVE_ITEM INCS ${ZLIB_INCLUDE_DIR}) + SET_PROPERTY(TARGET connect PROPERTY INCLUDE_DIRECTORIES ${INCS}) +ENDIF() + IF(WIN32) IF (libmongoc-1.0_FOUND) SET_TARGET_PROPERTIES(connect PROPERTIES LINK_FLAGS diff --git a/storage/connect/filter.cpp b/storage/connect/filter.cpp index 469cd90d1d7..7082b082c67 100644 --- a/storage/connect/filter.cpp +++ b/storage/connect/filter.cpp @@ -35,9 +35,6 @@ #include "array.h" #include "filter.h" #include "xindex.h" -#if defined(MONGO_SUPPORT) || defined(JDBC_SUPPORT) -#include "tabext.h" -#endif // MONGO_SUPPORT || JDBC_SUPPORT /***********************************************************************/ /* Utility routines. */ @@ -1406,86 +1403,6 @@ PFIL FILTER::Copy(PTABS t) } // end of Copy #endif // 0 -#if defined(MONGO_SUPPORT) -/***********************************************************************/ -/* Make selector json representation for Mongo tables. */ -/***********************************************************************/ -bool FILTER::MakeSelector(PGLOBAL g, PSTRG s) -{ - s->Append('{'); - - if (Opc == OP_AND || Opc == OP_OR) { - if (GetArgType(0) != TYPE_FILTER || GetArgType(1) != TYPE_FILTER) - return true; - - s->Append("\"$"); - s->Append(Opc == OP_AND ? "and" : "or"); - s->Append("\":["); - - if (((PFIL)Arg(0))->MakeSelector(g, s)) - return true; - - s->Append(','); - - if (((PFIL)Arg(1))->MakeSelector(g, s)) - return true; - - s->Append(']'); - } else { - if (GetArgType(0) != TYPE_COLBLK) - return true; - - s->Append('"'); - s->Append(((PCOL)Arg(0))->GetJpath(g, false)); - s->Append("\":{\"$"); - - switch (Opc) { - case OP_EQ: - s->Append("eq"); - break; - case OP_NE: - s->Append("ne"); - break; - case OP_GT: - s->Append("gt"); - break; - case OP_GE: - s->Append("gte"); - break; - case OP_LT: - s->Append("lt"); - break; - case OP_LE: - s->Append("lte"); - break; - case OP_NULL: - case OP_LIKE: - case OP_EXIST: - default: - return true; - } // endswitch Opc - - s->Append("\":"); - - if (GetArgType(1) == TYPE_COLBLK) { - s->Append("\"$"); - s->Append(((PEXTCOL)Arg(1))->GetJpath(g, false)); - s->Append('"'); - } else { - char buf[501]; - - Arg(1)->Prints(g, buf, 500); - s->Append(buf); - } // endif Type - - s->Append('}'); - } // endif Opc - - s->Append('}'); - return false; -} // end of MakeSelector -#endif // MONGO_SUPPORT - /*********************************************************************/ /* Make file output of FILTER contents. */ /*********************************************************************/ diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 40f9e90ff35..fc65c578e8d 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -1317,7 +1317,7 @@ char *ha_connect::GetRealString(PCSZ s) { char *sv; - if (IsPartitioned() && s && *partname) { + if (IsPartitioned() && s && partname && *partname) { sv= (char*)PlugSubAlloc(xp->g, NULL, 0); sprintf(sv, s, partname); PlugSubAlloc(xp->g, NULL, strlen(sv) + 1); diff --git a/storage/connect/jdbconn.cpp b/storage/connect/jdbconn.cpp index e54eeb0fcdd..e0aca3333e6 100644 --- a/storage/connect/jdbconn.cpp +++ b/storage/connect/jdbconn.cpp @@ -178,30 +178,38 @@ int TranslateJDBCType(int stp, char *tn, int prec, int& len, char& v) v = 'Y'; } // endif len - break; - case 92: // TIME - type = TYPE_DATE; - len = 8 + ((prec) ? (prec+1) : 0); - v = 'T'; - break; - case -5: // BIGINT - type = TYPE_BIGINT; - break; - case 0: // NULL - case -2: // BINARY - case -4: // LONGVARBINARY - case 70: // DATALINK - case 2000: // JAVA_OBJECT - case 2001: // DISTINCT - case 2002: // STRUCT - case 2003: // ARRAY - case 2004: // BLOB - case 2005: // CLOB - case 2006: // REF - case 2009: // SQLXML - case 2011: // NCLOB - default: - type = TYPE_ERROR; + break; + case 92: // TIME + type = TYPE_DATE; + len = 8 + ((prec) ? (prec + 1) : 0); + v = 'T'; + break; + case -5: // BIGINT + type = TYPE_BIGINT; + break; + case 1111: // UNKNOWN or UUID + if (!tn || !stricmp(tn, "UUID")) { + type = TYPE_STRING; + len = 36; + break; + } // endif tn + + // Pass through + case 0: // NULL + case -2: // BINARY + case -4: // LONGVARBINARY + case 70: // DATALINK + case 2000: // JAVA_OBJECT + case 2001: // DISTINCT + case 2002: // STRUCT + case 2003: // ARRAY + case 2004: // BLOB + case 2005: // CLOB + case 2006: // REF + case 2009: // SQLXML + case 2011: // NCLOB + default: + type = TYPE_ERROR; len = 0; } // endswitch type diff --git a/storage/connect/mycat.cc b/storage/connect/mycat.cc index ad80caef946..db56fb754fa 100644 --- a/storage/connect/mycat.cc +++ b/storage/connect/mycat.cc @@ -134,7 +134,9 @@ TABTYPE GetTypeID(const char *type) #endif #if defined(JAVA_SUPPORT) : (!stricmp(type, "JDBC")) ? TAB_JDBC - : (!stricmp(type, "MONGO")) ? TAB_MONGO +#endif +#if defined(JAVA_SUPPORT) || defined(CMGO_SUPPORT) + : (!stricmp(type, "MONGO") && MongoEnabled()) ? TAB_MONGO #endif #if defined(JAVA_SUPPORT) || defined(CMGO_SUPPORT) : (!stricmp(type, "MONGO") && MongoEnabled()) ? TAB_MONGO diff --git a/storage/connect/mysql-test/connect/disabled.def b/storage/connect/mysql-test/connect/disabled.def index 827ed58b835..1de4deb0a60 100644 --- a/storage/connect/mysql-test/connect/disabled.def +++ b/storage/connect/mysql-test/connect/disabled.def @@ -9,15 +9,15 @@ # Do not use any TAB characters for whitespace. # ############################################################################## -infoschema-9739 : Crashes with MariaDB 10.0 -jdbc : Variable settings depend on machine configuration -jdbc_new : Variable settings depend on machine configuration -jdbc_oracle : Variable settings depend on machine configuration -jdbc_postgresql : Variable settings depend on machine configuration -json_mongo_c : Need MongoDB running and its C Driver installed -json_java_2 : Need MongoDB running and its Java Driver installed -json_java_3 : Need MongoDB running and its Java Driver installed -mongo_c : Need MongoDB running and its C Driver installed -mongo_java_2 : Need MongoDB running and its Java Driver installed -mongo_java_3 : Need MongoDB running and its Java Driver installed -tbl_thread : Bug MDEV-9844,10179,14214 03/01/2018 OB Option THREAD removed +jdbc : Variable settings depend on machine configuration +jdbc_new : Variable settings depend on machine configuration +jdbc_oracle : Variable settings depend on machine configuration +jdbc_postgresql : Variable settings depend on machine configuration +json_mongo_c : Need MongoDB running and its C Driver installed +json_java_2 : Need MongoDB running and its Java Driver installed +json_java_3 : Need MongoDB running and its Java Driver installed +mongo_c : Need MongoDB running and its C Driver installed +mongo_java_2 : Need MongoDB running and its Java Driver installed +mongo_java_3 : Need MongoDB running and its Java Driver installed +tbl_thread : Bug MDEV-9844,10179,14214 03/01/2018 OB Option THREAD removed +#vcol : Different error code on different versions diff --git a/storage/connect/mysql-test/connect/r/jdbc.result b/storage/connect/mysql-test/connect/r/jdbc.result index 1bcd7b736bb..6bf67ec416f 100644 --- a/storage/connect/mysql-test/connect/r/jdbc.result +++ b/storage/connect/mysql-test/connect/r/jdbc.result @@ -239,22 +239,34 @@ CREATE TABLE t2 (command varchar(128) not null,number int(5) not null flag=1,mes SELECT * FROM t2 WHERE command='drop table tx1'; command number message drop table tx1 0 Execute: java.sql.SQLSyntaxErrorException: (conn:23) Unknown table 'connect.tx1' +Warnings: +Warning 1105 Execute: java.sql.SQLSyntaxErrorException: (conn:23) Unknown table 'connect.tx1' SELECT * FROM t2 WHERE command = 'create table tx1 (a int not null, b char(32), c double(8,2))'; command number message create table tx1 (a int not null, b char(32), c double(8,2)) 0 Affected rows +Warnings: +Warning 1105 Affected rows SELECT * FROM t2 WHERE command in ('insert into tx1 values(1,''The number one'',456.12)',"insert into tx1(a,b) values(2,'The number two'),(3,'The number three')"); command number message insert into tx1 values(1,'The number one',456.12) 1 Affected rows insert into tx1(a,b) values(2,'The number two'),(3,'The number three') 2 Affected rows +Warnings: +Warning 1105 Affected rows SELECT * FROM t2 WHERE command='update tx1 set c = 3.1416 where a = 2'; command number message update tx1 set c = 3.1416 where a = 2 1 Affected rows +Warnings: +Warning 1105 Affected rows SELECT * FROM t2 WHERE command='select * from tx1'; command number message select * from tx1 3 Result set column number +Warnings: +Warning 1105 Result set column number SELECT * FROM t2 WHERE command='delete from tx1 where a = 2'; command number message delete from tx1 where a = 2 1 Affected rows +Warnings: +Warning 1105 Affected rows SELECT * FROM connect.tx1; a b c 1 The number one 456.12 diff --git a/storage/connect/mysql-test/connect/r/json_java_2.result b/storage/connect/mysql-test/connect/r/json_java_2.result index ff87d8e2ad7..4bbac236200 100644 --- a/storage/connect/mysql-test/connect/r/json_java_2.result +++ b/storage/connect/mysql-test/connect/r/json_java_2.result @@ -381,7 +381,4 @@ planner 167 41.75 postcard 23 5.75 DROP TABLE t1; true -<<<<<<< HEAD -======= set connect_enable_mongo=0; ->>>>>>> connect/10.0 diff --git a/storage/connect/mysql-test/connect/r/tbl_thread.result b/storage/connect/mysql-test/connect/r/tbl_thread.result index 9633f358c97..3526fc43ffc 100644 --- a/storage/connect/mysql-test/connect/r/tbl_thread.result +++ b/storage/connect/mysql-test/connect/r/tbl_thread.result @@ -1,5 +1,10 @@ +connect master,127.0.0.1,root,,test,$MASTER_MYPORT,; +connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,; +connection master; CREATE DATABASE connect; +connection slave; CREATE DATABASE connect; +connection default; # # Checking thread TBL tables # @@ -11,6 +16,7 @@ a b 1 test01 2 test02 3 test03 +connection master; CREATE TABLE rt2 (a int, b char(10)); INSERT INTO rt2 VALUES (4,'test04'),(5,'test05'),(6,'test06'),(7,'test07'); SELECT * FROM rt2; @@ -19,6 +25,7 @@ a b 5 test05 6 test06 7 test07 +connection slave; USE test; CREATE TABLE rt3 (a int, b char(10)); INSERT INTO rt3 VALUES (8,'test08'),(9,'test09'),(10,'test10'),(11,'test11'); @@ -44,6 +51,7 @@ a b 17 test17 18 test18 19 test19 +connection default; CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL CONNECTION='mysql://root@127.0.0.1:MASTER_PORT/test/rt2'; SELECT * FROM t2; @@ -103,8 +111,11 @@ a b 1 test01 0 test00 set connect_xtrace=0; +connection master; DROP TABLE rt2; +connection slave; DROP TABLE rt3,rt4,rt5; +connection default; DROP TABLE t1,t2,t3,t4,t5,total; # # Old thread TBL tables test modified @@ -146,7 +157,9 @@ set connect_xtrace=0; DROP TABLE total; DROP TABLE t1; DROP TABLE t2; +connection master; DROP TABLE IF EXISTS connect.t1; DROP DATABASE IF EXISTS connect; +connection slave; DROP TABLE IF EXISTS connect.t1; DROP DATABASE IF EXISTS connect; |