Merge remote-tracking branch 'connect/10.3' into 10.3
This commit is contained in:
commit
5ac528a91f
@ -365,26 +365,26 @@ IF(CONNECT_WITH_REST)
|
|||||||
# MESSAGE(STATUS "=====> REST support is ON")
|
# MESSAGE(STATUS "=====> REST support is ON")
|
||||||
SET(CONNECT_SOURCES ${CONNECT_SOURCES} tabrest.cpp tabrest.h)
|
SET(CONNECT_SOURCES ${CONNECT_SOURCES} tabrest.cpp tabrest.h)
|
||||||
add_definitions(-DREST_SUPPORT)
|
add_definitions(-DREST_SUPPORT)
|
||||||
# FIND_PACKAGE(cpprestsdk QUIET)
|
# FIND_PACKAGE(cpprestsdk QUIET)
|
||||||
# IF (cpprestsdk_FOUND)
|
# IF (cpprestsdk_FOUND)
|
||||||
# IF(UNIX)
|
# IF(UNIX)
|
||||||
## INCLUDE_DIRECTORIES(${CPPRESTSDK_INCLUDE_DIR})
|
## INCLUDE_DIRECTORIES(${CPPRESTSDK_INCLUDE_DIR})
|
||||||
## If needed edit next line to set the path to libcpprest.so
|
## If needed edit next line to set the path to libcpprest.so
|
||||||
# SET(REST_LIBRARY -lcpprest)
|
# SET(REST_LIBRARY -lcpprest)
|
||||||
# MESSAGE (STATUS ${REST_LIBRARY})
|
# MESSAGE (STATUS ${REST_LIBRARY})
|
||||||
# ELSE(NOT UNIX)
|
# ELSE(NOT UNIX)
|
||||||
## Next line sets debug compile mode matching cpprest_2_10d.dll
|
## Next line sets debug compile mode matching cpprest_2_10d.dll
|
||||||
## when it was binary installed (can be change later in Visual Studio)
|
## when it was binary installed (can be change later in Visual Studio)
|
||||||
## Comment it out if not needed depending on your cpprestsdk installation.
|
## Comment it out if not needed depending on your cpprestsdk installation.
|
||||||
# SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd")
|
# SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd")
|
||||||
# ENDIF(UNIX)
|
# ENDIF(UNIX)
|
||||||
## IF(REST_LIBRARY) why this? how about Windows
|
## IF(REST_LIBRARY) why this? how about Windows
|
||||||
# SET(CONNECT_SOURCES ${CONNECT_SOURCES} restget.cpp)
|
# SET(CONNECT_SOURCES ${CONNECT_SOURCES} restget.cpp)
|
||||||
# add_definitions(-DREST_SOURCE)
|
# add_definitions(-DREST_SOURCE)
|
||||||
## ENDIF()
|
## ENDIF()
|
||||||
##ELSE(NOT cpprestsdk_FOUND)
|
## ELSE(NOT cpprestsdk_FOUND)
|
||||||
## MESSAGE(STATUS "=====> cpprestsdk package not found")
|
# MESSAGE(STATUS "=====> cpprestsdk package not found")
|
||||||
# ENDIF (cpprestsdk_FOUND)
|
# ENDIF (cpprestsdk_FOUND)
|
||||||
ENDIF(CONNECT_WITH_REST)
|
ENDIF(CONNECT_WITH_REST)
|
||||||
ADD_FEATURE_INFO(CONNECT_REST CONNECT_WITH_REST "Support for REST API in the CONNECT storage engine")
|
ADD_FEATURE_INFO(CONNECT_REST CONNECT_WITH_REST "Support for REST API in the CONNECT storage engine")
|
||||||
|
|
||||||
@ -414,28 +414,22 @@ IF(NOT TARGET connect)
|
|||||||
RETURN()
|
RETURN()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(WIN32)
|
IF(MSVC)
|
||||||
IF (libmongoc-1.0_FOUND)
|
IF (libmongoc-1.0_FOUND)
|
||||||
SET_TARGET_PROPERTIES(connect PROPERTIES LINK_FLAGS
|
SET_TARGET_PROPERTIES(connect PROPERTIES LINK_FLAGS
|
||||||
"/DELAYLOAD:libbson-1.0.dll /DELAYLOAD:libmongoc-1.0.dll")
|
"/DELAYLOAD:libbson-1.0.dll /DELAYLOAD:libmongoc-1.0.dll")
|
||||||
ENDIF(libmongoc-1.0_FOUND)
|
ENDIF()
|
||||||
|
# Temporarily disable "conversion from size_t .." warnings
|
||||||
# Install some extra files that belong to connect engine
|
|
||||||
|
|
||||||
INSTALL(FILES "$<TARGET_FILE_DIR:connect>/ha_connect.lib"
|
|
||||||
DESTINATION ${INSTALL_PLUGINDIR} COMPONENT connect-engine)
|
|
||||||
ENDIF(WIN32)
|
|
||||||
|
|
||||||
IF(MSVC)
|
|
||||||
# Temporarily disable "conversion from size_t .."
|
|
||||||
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267")
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267")
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4267")
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4996")
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4996")
|
||||||
string(REPLACE "/permissive-" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
string(REPLACE "/permissive-" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
|
INSTALL(FILES "$<TARGET_FILE_DIR:connect>/ha_connect.lib"
|
||||||
|
DESTINATION ${INSTALL_PLUGINDIR} COMPONENT connect-engine)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
IF(CONNECT_WITH_JDBC AND JAVA_FOUND AND JNI_FOUND)
|
IF(CONNECT_WITH_JDBC AND JAVA_FOUND AND JNI_FOUND)
|
||||||
# TODO: Find how to compile and install the java wrapper classes
|
# TODO: Find how to compile and install the java wrapper classes
|
||||||
# Find required libraries and include directories
|
# Find required libraries and include directories
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
|
||||||
|
|
||||||
/**************** Cnt H Declares Source Code File (.H) *****************/
|
/**************** Cnt H Declares Source Code File (.H) *****************/
|
||||||
/* Name: CONNECT.H Version 2.4 */
|
/* Name: CONNECT.H Version 2.4 */
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@file ha_connect.cc
|
@file ha_connect.cc
|
||||||
@ -266,7 +266,7 @@ bool Force_Bson(void);
|
|||||||
size_t GetWorkSize(void);
|
size_t GetWorkSize(void);
|
||||||
void SetWorkSize(size_t);
|
void SetWorkSize(size_t);
|
||||||
extern "C" const char *msglang(void);
|
extern "C" const char *msglang(void);
|
||||||
|
static char *strz(PGLOBAL g, LEX_CSTRING &ls);
|
||||||
static void PopUser(PCONNECT xp);
|
static void PopUser(PCONNECT xp);
|
||||||
static PCONNECT GetUser(THD *thd, PCONNECT xp);
|
static PCONNECT GetUser(THD *thd, PCONNECT xp);
|
||||||
static PGLOBAL GetPlug(THD *thd, PCONNECT& lxp);
|
static PGLOBAL GetPlug(THD *thd, PCONNECT& lxp);
|
||||||
@ -1301,10 +1301,10 @@ PCSZ GetStringTableOption(PGLOBAL g, PTOS options, PCSZ opname, PCSZ sdef)
|
|||||||
opval= options->filter;
|
opval= options->filter;
|
||||||
else if (!stricmp(opname, "Data_charset"))
|
else if (!stricmp(opname, "Data_charset"))
|
||||||
opval= options->data_charset;
|
opval= options->data_charset;
|
||||||
else if (!stricmp(opname, "Http") || !stricmp(opname, "URL"))
|
else if (!stricmp(opname, "Http") || !stricmp(opname, "URL"))
|
||||||
opval= options->http;
|
opval= options->http;
|
||||||
else if (!stricmp(opname, "Uri"))
|
else if (!stricmp(opname, "Uri"))
|
||||||
opval= options->uri;
|
opval= options->uri;
|
||||||
|
|
||||||
if (!opval && options->oplist)
|
if (!opval && options->oplist)
|
||||||
opval= GetListOption(g, opname, options->oplist);
|
opval= GetListOption(g, opname, options->oplist);
|
||||||
@ -5642,7 +5642,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
|
|||||||
String sql(buf, sizeof(buf), system_charset_info);
|
String sql(buf, sizeof(buf), system_charset_info);
|
||||||
|
|
||||||
sql.copy(STRING_WITH_LEN("CREATE TABLE whatever ("), system_charset_info);
|
sql.copy(STRING_WITH_LEN("CREATE TABLE whatever ("), system_charset_info);
|
||||||
user= host= pwd= tbl= src= col= ocl= pic= fcl= skc= rnk= zfn= NULL;
|
user= host= pwd= tbl= src= col= ocl= pic= fcl= skc= rnk= zfn= NULL;
|
||||||
dsn= url= NULL;
|
dsn= url= NULL;
|
||||||
|
|
||||||
// Get the useful create options
|
// Get the useful create options
|
||||||
@ -5694,7 +5694,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
|
|||||||
#if defined(ZIP_SUPPORT)
|
#if defined(ZIP_SUPPORT)
|
||||||
zfn= GetListOption(g, "Zipfile", topt->oplist, NULL);
|
zfn= GetListOption(g, "Zipfile", topt->oplist, NULL);
|
||||||
#endif // ZIP_SUPPORT
|
#endif // ZIP_SUPPORT
|
||||||
} else {
|
} else {
|
||||||
host= "localhost";
|
host= "localhost";
|
||||||
user= ((ttp == TAB_ODBC || ttp == TAB_JDBC) ? NULL : "root");
|
user= ((ttp == TAB_ODBC || ttp == TAB_JDBC) ? NULL : "root");
|
||||||
} // endif option_list
|
} // endif option_list
|
||||||
@ -5831,17 +5831,17 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
|
|||||||
PJDBCDEF jdef= new(g) JDBCDEF();
|
PJDBCDEF jdef= new(g) JDBCDEF();
|
||||||
|
|
||||||
jdef->SetName(create_info->alias.str);
|
jdef->SetName(create_info->alias.str);
|
||||||
sjp = (PJPARM)PlugSubAlloc(g, NULL, sizeof(JDBCPARM));
|
sjp= (PJPARM)PlugSubAlloc(g, NULL, sizeof(JDBCPARM));
|
||||||
sjp->Driver = driver;
|
sjp->Driver= driver;
|
||||||
// sjp->Properties = prop;
|
// sjp->Properties= prop;
|
||||||
sjp->Fsize = 0;
|
sjp->Fsize= 0;
|
||||||
sjp->Scrollable = false;
|
sjp->Scrollable= false;
|
||||||
|
|
||||||
if ((rc = jdef->ParseURL(g, url, false)) == RC_OK) {
|
if ((rc= jdef->ParseURL(g, url, false)) == RC_OK) {
|
||||||
sjp->Url = url;
|
sjp->Url= url;
|
||||||
sjp->User = (char*)user;
|
sjp->User= (char*)user;
|
||||||
sjp->Pwd = (char*)pwd;
|
sjp->Pwd= (char*)pwd;
|
||||||
ok = true;
|
ok= true;
|
||||||
} else if (rc == RC_NF) {
|
} else if (rc == RC_NF) {
|
||||||
if (jdef->GetTabname())
|
if (jdef->GetTabname())
|
||||||
tab= (char*)jdef->GetTabname();
|
tab= (char*)jdef->GetTabname();
|
||||||
@ -5955,11 +5955,11 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
|
|||||||
break;
|
break;
|
||||||
#endif // JAVA_SUPPORT
|
#endif // JAVA_SUPPORT
|
||||||
#if defined(REST_SUPPORT)
|
#if defined(REST_SUPPORT)
|
||||||
case TAB_REST:
|
case TAB_REST:
|
||||||
if (!topt->http)
|
if (!topt->http)
|
||||||
strcpy(g->Message, "Missing REST HTTP option");
|
sprintf(g->Message, "Missing %s HTTP address", topt->type);
|
||||||
else
|
else
|
||||||
ok = true;
|
ok= true;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
#endif // REST_SUPPORT
|
#endif // REST_SUPPORT
|
||||||
@ -6123,11 +6123,11 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
|
|||||||
break;
|
break;
|
||||||
#endif // LIBXML2_SUPPORT || DOMDOC_SUPPORT
|
#endif // LIBXML2_SUPPORT || DOMDOC_SUPPORT
|
||||||
#if defined(REST_SUPPORT)
|
#if defined(REST_SUPPORT)
|
||||||
case TAB_REST:
|
case TAB_REST:
|
||||||
qrp = RESTColumns(g, topt, tab, (char *)db, fnc == FNC_COL);
|
qrp= RESTColumns(g, topt, tab, (char *)db, fnc == FNC_COL);
|
||||||
break;
|
break;
|
||||||
#endif // REST_SUPPORT
|
#endif // REST_SUPPORT
|
||||||
case TAB_OEM:
|
case TAB_OEM:
|
||||||
qrp= OEMColumns(g, topt, tab, (char*)db, fnc == FNC_COL);
|
qrp= OEMColumns(g, topt, tab, (char*)db, fnc == FNC_COL);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -6444,7 +6444,7 @@ int ha_connect::create(const char *name, TABLE *table_arg,
|
|||||||
TABTYPE type;
|
TABTYPE type;
|
||||||
TABLE *st= table; // Probably unuseful
|
TABLE *st= table; // Probably unuseful
|
||||||
THD *thd= ha_thd();
|
THD *thd= ha_thd();
|
||||||
LEX_CSTRING cnc = table_arg->s->connect_string;
|
LEX_CSTRING cnc= table_arg->s->connect_string;
|
||||||
#if defined(WITH_PARTITION_STORAGE_ENGINE)
|
#if defined(WITH_PARTITION_STORAGE_ENGINE)
|
||||||
partition_info *part_info= table_arg->part_info;
|
partition_info *part_info= table_arg->part_info;
|
||||||
#else // !WITH_PARTITION_STORAGE_ENGINE
|
#else // !WITH_PARTITION_STORAGE_ENGINE
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
|
||||||
|
|
||||||
/** @file ha_connect.h
|
/** @file ha_connect.h
|
||||||
Author Olivier Bertrand
|
Author Olivier Bertrand
|
||||||
|
@ -1815,7 +1815,7 @@ static PCSZ MakeKey(PGLOBAL g, UDF_ARGS *args, int i)
|
|||||||
} // endif *s
|
} // endif *s
|
||||||
|
|
||||||
if (n < 1)
|
if (n < 1)
|
||||||
return (PCSZ) "Key";
|
return (PCSZ) "Key";
|
||||||
|
|
||||||
if (!b) {
|
if (!b) {
|
||||||
if ((p = (PSZ)PlgDBSubAlloc(g, NULL, n + 1))) {
|
if ((p = (PSZ)PlgDBSubAlloc(g, NULL, n + 1))) {
|
||||||
@ -1829,7 +1829,7 @@ static PCSZ MakeKey(PGLOBAL g, UDF_ARGS *args, int i)
|
|||||||
|
|
||||||
} // endif s
|
} // endif s
|
||||||
|
|
||||||
return (char*) s;
|
return s;
|
||||||
} // endif count
|
} // endif count
|
||||||
|
|
||||||
return (PCSZ) "Key";
|
return (PCSZ) "Key";
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
SET GLOBAL connect_class_path='C:/MariaDB-10.2/MariaDB/storage/connect/mysql-test/connect/std_data/JavaWrappers.jar;C:/Jconnectors/postgresql-42.2.1.jar';
|
SET GLOBAL connect_class_path='C:/MariaDB-10.0/MariaDB/storage/connect/mysql-test/connect/std_data/JavaWrappers.jar;C:/Jconnectors/postgresql-42.2.1.jar';
|
||||||
CREATE TABLE t2 (
|
CREATE TABLE t2 (
|
||||||
command varchar(128) not null,
|
command varchar(128) not null,
|
||||||
number int(5) not null flag=1,
|
number int(5) not null flag=1,
|
||||||
|
@ -771,7 +771,7 @@ void WMICOL::ReadColumn(PGLOBAL g)
|
|||||||
break;
|
break;
|
||||||
case VT_I4:
|
case VT_I4:
|
||||||
case VT_UI4:
|
case VT_UI4:
|
||||||
Value->SetValue(Prop.lVal);
|
Value->SetValue((long long)Prop.lVal);
|
||||||
break;
|
break;
|
||||||
case VT_I2:
|
case VT_I2:
|
||||||
case VT_UI2:
|
case VT_UI2:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user