Commit 25d216dc authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

Merge remote-tracking branch 'connect/10.1' into 10.1

parents 584d2132 fe718541
...@@ -114,6 +114,7 @@ IF(CONNECT_WITH_LIBXML2) ...@@ -114,6 +114,7 @@ IF(CONNECT_WITH_LIBXML2)
FIND_PACKAGE(LibXml2) FIND_PACKAGE(LibXml2)
IF (LIBXML2_FOUND) IF (LIBXML2_FOUND)
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
SET(ZLIB_LIBRARY "z") # see ZLIB_INCLUDE_DIR below
SET(XML_LIBRARY ${LIBXML2_LIBRARIES}) SET(XML_LIBRARY ${LIBXML2_LIBRARIES})
SET(CONNECT_SOURCES ${CONNECT_SOURCES} libdoc.cpp libdoc.h) SET(CONNECT_SOURCES ${CONNECT_SOURCES} libdoc.cpp libdoc.h)
add_definitions(-DLIBXML2_SUPPORT) add_definitions(-DLIBXML2_SUPPORT)
...@@ -332,6 +333,14 @@ IF(NOT TARGET connect) ...@@ -332,6 +333,14 @@ IF(NOT TARGET connect)
RETURN() RETURN()
ENDIF() 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(WIN32)
IF (libmongoc-1.0_FOUND) IF (libmongoc-1.0_FOUND)
SET_TARGET_PROPERTIES(connect PROPERTIES LINK_FLAGS SET_TARGET_PROPERTIES(connect PROPERTIES LINK_FLAGS
......
...@@ -35,9 +35,6 @@ ...@@ -35,9 +35,6 @@
#include "array.h" #include "array.h"
#include "filter.h" #include "filter.h"
#include "xindex.h" #include "xindex.h"
#if defined(MONGO_SUPPORT) || defined(JDBC_SUPPORT)
#include "tabext.h"
#endif // MONGO_SUPPORT || JDBC_SUPPORT
/***********************************************************************/ /***********************************************************************/
/* Utility routines. */ /* Utility routines. */
...@@ -1406,86 +1403,6 @@ PFIL FILTER::Copy(PTABS t) ...@@ -1406,86 +1403,6 @@ PFIL FILTER::Copy(PTABS t)
} // end of Copy } // end of Copy
#endif // 0 #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. */ /* Make file output of FILTER contents. */
/*********************************************************************/ /*********************************************************************/
......
...@@ -1317,7 +1317,7 @@ char *ha_connect::GetRealString(PCSZ s) ...@@ -1317,7 +1317,7 @@ char *ha_connect::GetRealString(PCSZ s)
{ {
char *sv; char *sv;
if (IsPartitioned() && s && *partname) { if (IsPartitioned() && s && partname && *partname) {
sv= (char*)PlugSubAlloc(xp->g, NULL, 0); sv= (char*)PlugSubAlloc(xp->g, NULL, 0);
sprintf(sv, s, partname); sprintf(sv, s, partname);
PlugSubAlloc(xp->g, NULL, strlen(sv) + 1); PlugSubAlloc(xp->g, NULL, strlen(sv) + 1);
......
...@@ -178,30 +178,38 @@ int TranslateJDBCType(int stp, char *tn, int prec, int& len, char& v) ...@@ -178,30 +178,38 @@ int TranslateJDBCType(int stp, char *tn, int prec, int& len, char& v)
v = 'Y'; v = 'Y';
} // endif len } // endif len
break; break;
case 92: // TIME case 92: // TIME
type = TYPE_DATE; type = TYPE_DATE;
len = 8 + ((prec) ? (prec+1) : 0); len = 8 + ((prec) ? (prec + 1) : 0);
v = 'T'; v = 'T';
break; break;
case -5: // BIGINT case -5: // BIGINT
type = TYPE_BIGINT; type = TYPE_BIGINT;
break; break;
case 0: // NULL case 1111: // UNKNOWN or UUID
case -2: // BINARY if (!tn || !stricmp(tn, "UUID")) {
case -4: // LONGVARBINARY type = TYPE_STRING;
case 70: // DATALINK len = 36;
case 2000: // JAVA_OBJECT break;
case 2001: // DISTINCT } // endif tn
case 2002: // STRUCT
case 2003: // ARRAY // Pass through
case 2004: // BLOB case 0: // NULL
case 2005: // CLOB case -2: // BINARY
case 2006: // REF case -4: // LONGVARBINARY
case 2009: // SQLXML case 70: // DATALINK
case 2011: // NCLOB case 2000: // JAVA_OBJECT
default: case 2001: // DISTINCT
type = TYPE_ERROR; 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; len = 0;
} // endswitch type } // endswitch type
......
...@@ -134,7 +134,9 @@ TABTYPE GetTypeID(const char *type) ...@@ -134,7 +134,9 @@ TABTYPE GetTypeID(const char *type)
#endif #endif
#if defined(JAVA_SUPPORT) #if defined(JAVA_SUPPORT)
: (!stricmp(type, "JDBC")) ? TAB_JDBC : (!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 #endif
#if defined(JAVA_SUPPORT) || defined(CMGO_SUPPORT) #if defined(JAVA_SUPPORT) || defined(CMGO_SUPPORT)
: (!stricmp(type, "MONGO") && MongoEnabled()) ? TAB_MONGO : (!stricmp(type, "MONGO") && MongoEnabled()) ? TAB_MONGO
......
...@@ -9,15 +9,15 @@ ...@@ -9,15 +9,15 @@
# Do not use any TAB characters for whitespace. # Do not use any TAB characters for whitespace.
# #
############################################################################## ##############################################################################
infoschema-9739 : Crashes with MariaDB 10.0 jdbc : Variable settings depend on machine configuration
jdbc : Variable settings depend on machine configuration jdbc_new : Variable settings depend on machine configuration
jdbc_new : Variable settings depend on machine configuration jdbc_oracle : Variable settings depend on machine configuration
jdbc_oracle : Variable settings depend on machine configuration jdbc_postgresql : 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_mongo_c : Need MongoDB running and its C Driver installed json_java_2 : Need MongoDB running and its Java Driver installed
json_java_2 : Need MongoDB running and its Java Driver installed json_java_3 : 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_c : Need MongoDB running and its C Driver installed mongo_java_2 : Need MongoDB running and its Java Driver installed
mongo_java_2 : Need MongoDB running and its Java Driver installed mongo_java_3 : 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
tbl_thread : Bug MDEV-9844,10179,14214 03/01/2018 OB Option THREAD removed #vcol : Different error code on different versions
...@@ -239,22 +239,34 @@ CREATE TABLE t2 (command varchar(128) not null,number int(5) not null flag=1,mes ...@@ -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'; SELECT * FROM t2 WHERE command='drop table tx1';
command number message command number message
drop table tx1 0 Execute: java.sql.SQLSyntaxErrorException: (conn:23) Unknown table 'connect.tx1' 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))'; SELECT * FROM t2 WHERE command = 'create table tx1 (a int not null, b char(32), c double(8,2))';
command number message command number message
create table tx1 (a int not null, b char(32), c double(8,2)) 0 Affected rows 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')"); 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 command number message
insert into tx1 values(1,'The number one',456.12) 1 Affected rows 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 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'; SELECT * FROM t2 WHERE command='update tx1 set c = 3.1416 where a = 2';
command number message command number message
update tx1 set c = 3.1416 where a = 2 1 Affected rows 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'; SELECT * FROM t2 WHERE command='select * from tx1';
command number message command number message
select * from tx1 3 Result set column number 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'; SELECT * FROM t2 WHERE command='delete from tx1 where a = 2';
command number message command number message
delete from tx1 where a = 2 1 Affected rows delete from tx1 where a = 2 1 Affected rows
Warnings:
Warning 1105 Affected rows
SELECT * FROM connect.tx1; SELECT * FROM connect.tx1;
a b c a b c
1 The number one 456.12 1 The number one 456.12
......
...@@ -381,7 +381,4 @@ planner 167 41.75 ...@@ -381,7 +381,4 @@ planner 167 41.75
postcard 23 5.75 postcard 23 5.75
DROP TABLE t1; DROP TABLE t1;
true true
<<<<<<< HEAD
=======
set connect_enable_mongo=0; set connect_enable_mongo=0;
>>>>>>> connect/10.0
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; CREATE DATABASE connect;
connection slave;
CREATE DATABASE connect; CREATE DATABASE connect;
connection default;
# #
# Checking thread TBL tables # Checking thread TBL tables
# #
...@@ -11,6 +16,7 @@ a b ...@@ -11,6 +16,7 @@ a b
1 test01 1 test01
2 test02 2 test02
3 test03 3 test03
connection master;
CREATE TABLE rt2 (a int, b char(10)); CREATE TABLE rt2 (a int, b char(10));
INSERT INTO rt2 VALUES (4,'test04'),(5,'test05'),(6,'test06'),(7,'test07'); INSERT INTO rt2 VALUES (4,'test04'),(5,'test05'),(6,'test06'),(7,'test07');
SELECT * FROM rt2; SELECT * FROM rt2;
...@@ -19,6 +25,7 @@ a b ...@@ -19,6 +25,7 @@ a b
5 test05 5 test05
6 test06 6 test06
7 test07 7 test07
connection slave;
USE test; USE test;
CREATE TABLE rt3 (a int, b char(10)); CREATE TABLE rt3 (a int, b char(10));
INSERT INTO rt3 VALUES (8,'test08'),(9,'test09'),(10,'test10'),(11,'test11'); INSERT INTO rt3 VALUES (8,'test08'),(9,'test09'),(10,'test10'),(11,'test11');
...@@ -44,6 +51,7 @@ a b ...@@ -44,6 +51,7 @@ a b
17 test17 17 test17
18 test18 18 test18
19 test19 19 test19
connection default;
CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL
CONNECTION='mysql://root@127.0.0.1:MASTER_PORT/test/rt2'; CONNECTION='mysql://root@127.0.0.1:MASTER_PORT/test/rt2';
SELECT * FROM t2; SELECT * FROM t2;
...@@ -103,8 +111,11 @@ a b ...@@ -103,8 +111,11 @@ a b
1 test01 1 test01
0 test00 0 test00
set connect_xtrace=0; set connect_xtrace=0;
connection master;
DROP TABLE rt2; DROP TABLE rt2;
connection slave;
DROP TABLE rt3,rt4,rt5; DROP TABLE rt3,rt4,rt5;
connection default;
DROP TABLE t1,t2,t3,t4,t5,total; DROP TABLE t1,t2,t3,t4,t5,total;
# #
# Old thread TBL tables test modified # Old thread TBL tables test modified
...@@ -146,7 +157,9 @@ set connect_xtrace=0; ...@@ -146,7 +157,9 @@ set connect_xtrace=0;
DROP TABLE total; DROP TABLE total;
DROP TABLE t1; DROP TABLE t1;
DROP TABLE t2; DROP TABLE t2;
connection master;
DROP TABLE IF EXISTS connect.t1; DROP TABLE IF EXISTS connect.t1;
DROP DATABASE IF EXISTS connect; DROP DATABASE IF EXISTS connect;
connection slave;
DROP TABLE IF EXISTS connect.t1; DROP TABLE IF EXISTS connect.t1;
DROP DATABASE IF EXISTS connect; DROP DATABASE IF EXISTS connect;
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