Skip to content

Commit 5ac528a

Browse files
committed
Merge remote-tracking branch 'connect/10.3' into 10.3
2 parents 182a638 + e316352 commit 5ac528a

File tree

7 files changed

+57
-63
lines changed

7 files changed

+57
-63
lines changed

storage/connect/CMakeLists.txt

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -365,26 +365,26 @@ IF(CONNECT_WITH_REST)
365365
# MESSAGE(STATUS "=====> REST support is ON")
366366
SET(CONNECT_SOURCES ${CONNECT_SOURCES} tabrest.cpp tabrest.h)
367367
add_definitions(-DREST_SUPPORT)
368-
# FIND_PACKAGE(cpprestsdk QUIET)
369-
# IF (cpprestsdk_FOUND)
368+
# FIND_PACKAGE(cpprestsdk QUIET)
369+
# IF (cpprestsdk_FOUND)
370370
# IF(UNIX)
371-
## INCLUDE_DIRECTORIES(${CPPRESTSDK_INCLUDE_DIR})
372-
## If needed edit next line to set the path to libcpprest.so
373-
# SET(REST_LIBRARY -lcpprest)
374-
# MESSAGE (STATUS ${REST_LIBRARY})
371+
## INCLUDE_DIRECTORIES(${CPPRESTSDK_INCLUDE_DIR})
372+
## If needed edit next line to set the path to libcpprest.so
373+
# SET(REST_LIBRARY -lcpprest)
374+
# MESSAGE (STATUS ${REST_LIBRARY})
375375
# ELSE(NOT UNIX)
376-
## Next line sets debug compile mode matching cpprest_2_10d.dll
377-
## when it was binary installed (can be change later in Visual Studio)
378-
## Comment it out if not needed depending on your cpprestsdk installation.
376+
## Next line sets debug compile mode matching cpprest_2_10d.dll
377+
## when it was binary installed (can be change later in Visual Studio)
378+
## Comment it out if not needed depending on your cpprestsdk installation.
379379
# SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd")
380380
# ENDIF(UNIX)
381-
## IF(REST_LIBRARY) why this? how about Windows
382-
# SET(CONNECT_SOURCES ${CONNECT_SOURCES} restget.cpp)
383-
# add_definitions(-DREST_SOURCE)
384-
## ENDIF()
385-
##ELSE(NOT cpprestsdk_FOUND)
386-
## MESSAGE(STATUS "=====> cpprestsdk package not found")
387-
# ENDIF (cpprestsdk_FOUND)
381+
## IF(REST_LIBRARY) why this? how about Windows
382+
# SET(CONNECT_SOURCES ${CONNECT_SOURCES} restget.cpp)
383+
# add_definitions(-DREST_SOURCE)
384+
## ENDIF()
385+
## ELSE(NOT cpprestsdk_FOUND)
386+
# MESSAGE(STATUS "=====> cpprestsdk package not found")
387+
# ENDIF (cpprestsdk_FOUND)
388388
ENDIF(CONNECT_WITH_REST)
389389
ADD_FEATURE_INFO(CONNECT_REST CONNECT_WITH_REST "Support for REST API in the CONNECT storage engine")
390390

@@ -414,28 +414,22 @@ IF(NOT TARGET connect)
414414
RETURN()
415415
ENDIF()
416416

417-
IF(WIN32)
417+
IF(MSVC)
418418
IF (libmongoc-1.0_FOUND)
419419
SET_TARGET_PROPERTIES(connect PROPERTIES LINK_FLAGS
420420
"/DELAYLOAD:libbson-1.0.dll /DELAYLOAD:libmongoc-1.0.dll")
421-
ENDIF(libmongoc-1.0_FOUND)
422-
423-
# Install some extra files that belong to connect engine
424-
425-
INSTALL(FILES "$<TARGET_FILE_DIR:connect>/ha_connect.lib"
426-
DESTINATION ${INSTALL_PLUGINDIR} COMPONENT connect-engine)
427-
ENDIF(WIN32)
428-
429-
IF(MSVC)
430-
# Temporarily disable "conversion from size_t .."
421+
ENDIF()
422+
# Temporarily disable "conversion from size_t .." warnings
431423
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
432424
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267")
433-
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4267")
434425
ENDIF()
435426
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4996")
436427
string(REPLACE "/permissive-" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
428+
INSTALL(FILES "$<TARGET_FILE_DIR:connect>/ha_connect.lib"
429+
DESTINATION ${INSTALL_PLUGINDIR} COMPONENT connect-engine)
437430
ENDIF()
438431

432+
439433
IF(CONNECT_WITH_JDBC AND JAVA_FOUND AND JNI_FOUND)
440434
# TODO: Find how to compile and install the java wrapper classes
441435
# Find required libraries and include directories

storage/connect/connect.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
1212
You should have received a copy of the GNU General Public License
1313
along with this program; if not, write to the Free Software
14-
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
14+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
1515

1616
/**************** Cnt H Declares Source Code File (.H) *****************/
1717
/* Name: CONNECT.H Version 2.4 */

storage/connect/ha_connect.cc

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
1212
You should have received a copy of the GNU General Public License
1313
along with this program; if not, write to the Free Software
14-
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
14+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
1515

1616
/**
1717
@file ha_connect.cc
@@ -266,7 +266,7 @@ bool Force_Bson(void);
266266
size_t GetWorkSize(void);
267267
void SetWorkSize(size_t);
268268
extern "C" const char *msglang(void);
269-
269+
static char *strz(PGLOBAL g, LEX_CSTRING &ls);
270270
static void PopUser(PCONNECT xp);
271271
static PCONNECT GetUser(THD *thd, PCONNECT xp);
272272
static PGLOBAL GetPlug(THD *thd, PCONNECT& lxp);
@@ -1301,10 +1301,10 @@ PCSZ GetStringTableOption(PGLOBAL g, PTOS options, PCSZ opname, PCSZ sdef)
13011301
opval= options->filter;
13021302
else if (!stricmp(opname, "Data_charset"))
13031303
opval= options->data_charset;
1304-
else if (!stricmp(opname, "Http") || !stricmp(opname, "URL"))
1305-
opval= options->http;
1306-
else if (!stricmp(opname, "Uri"))
1307-
opval= options->uri;
1304+
else if (!stricmp(opname, "Http") || !stricmp(opname, "URL"))
1305+
opval= options->http;
1306+
else if (!stricmp(opname, "Uri"))
1307+
opval= options->uri;
13081308

13091309
if (!opval && options->oplist)
13101310
opval= GetListOption(g, opname, options->oplist);
@@ -5642,7 +5642,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
56425642
String sql(buf, sizeof(buf), system_charset_info);
56435643

56445644
sql.copy(STRING_WITH_LEN("CREATE TABLE whatever ("), system_charset_info);
5645-
user= host= pwd= tbl= src= col= ocl= pic= fcl= skc= rnk= zfn= NULL;
5645+
user= host= pwd= tbl= src= col= ocl= pic= fcl= skc= rnk= zfn= NULL;
56465646
dsn= url= NULL;
56475647

56485648
// Get the useful create options
@@ -5694,7 +5694,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
56945694
#if defined(ZIP_SUPPORT)
56955695
zfn= GetListOption(g, "Zipfile", topt->oplist, NULL);
56965696
#endif // ZIP_SUPPORT
5697-
} else {
5697+
} else {
56985698
host= "localhost";
56995699
user= ((ttp == TAB_ODBC || ttp == TAB_JDBC) ? NULL : "root");
57005700
} // endif option_list
@@ -5831,17 +5831,17 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
58315831
PJDBCDEF jdef= new(g) JDBCDEF();
58325832

58335833
jdef->SetName(create_info->alias.str);
5834-
sjp = (PJPARM)PlugSubAlloc(g, NULL, sizeof(JDBCPARM));
5835-
sjp->Driver = driver;
5836-
//sjp->Properties = prop;
5837-
sjp->Fsize = 0;
5838-
sjp->Scrollable = false;
5839-
5840-
if ((rc = jdef->ParseURL(g, url, false)) == RC_OK) {
5841-
sjp->Url = url;
5842-
sjp->User = (char*)user;
5843-
sjp->Pwd = (char*)pwd;
5844-
ok = true;
5834+
sjp= (PJPARM)PlugSubAlloc(g, NULL, sizeof(JDBCPARM));
5835+
sjp->Driver= driver;
5836+
//sjp->Properties= prop;
5837+
sjp->Fsize= 0;
5838+
sjp->Scrollable= false;
5839+
5840+
if ((rc= jdef->ParseURL(g, url, false)) == RC_OK) {
5841+
sjp->Url= url;
5842+
sjp->User= (char*)user;
5843+
sjp->Pwd= (char*)pwd;
5844+
ok= true;
58455845
} else if (rc == RC_NF) {
58465846
if (jdef->GetTabname())
58475847
tab= (char*)jdef->GetTabname();
@@ -5955,11 +5955,11 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
59555955
break;
59565956
#endif // JAVA_SUPPORT
59575957
#if defined(REST_SUPPORT)
5958-
case TAB_REST:
5959-
if (!topt->http)
5960-
strcpy(g->Message, "Missing REST HTTP option");
5961-
else
5962-
ok = true;
5958+
case TAB_REST:
5959+
if (!topt->http)
5960+
sprintf(g->Message, "Missing %s HTTP address", topt->type);
5961+
else
5962+
ok= true;
59635963

59645964
break;
59655965
#endif // REST_SUPPORT
@@ -6123,11 +6123,11 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
61236123
break;
61246124
#endif // LIBXML2_SUPPORT || DOMDOC_SUPPORT
61256125
#if defined(REST_SUPPORT)
6126-
case TAB_REST:
6127-
qrp = RESTColumns(g, topt, tab, (char *)db, fnc == FNC_COL);
6128-
break;
6126+
case TAB_REST:
6127+
qrp= RESTColumns(g, topt, tab, (char *)db, fnc == FNC_COL);
6128+
break;
61296129
#endif // REST_SUPPORT
6130-
case TAB_OEM:
6130+
case TAB_OEM:
61316131
qrp= OEMColumns(g, topt, tab, (char*)db, fnc == FNC_COL);
61326132
break;
61336133
default:
@@ -6444,7 +6444,7 @@ int ha_connect::create(const char *name, TABLE *table_arg,
64446444
TABTYPE type;
64456445
TABLE *st= table; // Probably unuseful
64466446
THD *thd= ha_thd();
6447-
LEX_CSTRING cnc = table_arg->s->connect_string;
6447+
LEX_CSTRING cnc= table_arg->s->connect_string;
64486448
#if defined(WITH_PARTITION_STORAGE_ENGINE)
64496449
partition_info *part_info= table_arg->part_info;
64506450
#else// !WITH_PARTITION_STORAGE_ENGINE

storage/connect/ha_connect.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
1212
You should have received a copy of the GNU General Public License
1313
along with this program; if not, write to the Free Software
14-
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
14+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
1515

1616
/** @file ha_connect.h
1717
Author Olivier Bertrand

storage/connect/jsonudf.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1815,7 +1815,7 @@ static PCSZ MakeKey(PGLOBAL g, UDF_ARGS *args, int i)
18151815
} // endif *s
18161816

18171817
if (n < 1)
1818-
return (PCSZ) "Key";
1818+
return (PCSZ) "Key";
18191819

18201820
if (!b) {
18211821
if ((p = (PSZ)PlgDBSubAlloc(g, NULL, n + 1))) {
@@ -1829,7 +1829,7 @@ static PCSZ MakeKey(PGLOBAL g, UDF_ARGS *args, int i)
18291829

18301830
} // endif s
18311831

1832-
return (char*) s;
1832+
return s;
18331833
} // endif count
18341834

18351835
return (PCSZ) "Key";

storage/connect/mysql-test/connect/r/jdbc_postgresql.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
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';
1+
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';
22
CREATE TABLE t2 (
33
command varchar(128) not null,
44
number int(5) not null flag=1,

storage/connect/tabwmi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ void WMICOL::ReadColumn(PGLOBAL g)
771771
break;
772772
case VT_I4:
773773
case VT_UI4:
774-
Value->SetValue(Prop.lVal);
774+
Value->SetValue((long long)Prop.lVal);
775775
break;
776776
case VT_I2:
777777
case VT_UI2:

0 commit comments

Comments
 (0)