Skip to content

Commit b0ff5a6

Browse files
committed
Merge branch '10.2' into 10.3
2 parents 597b070 + d5a11a1 commit b0ff5a6

33 files changed

+2078
-1585
lines changed

libmariadb

sql/item.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ class Item: public Value_source,
670670
/* Cache of the result of is_expensive(). */
671671
int8 is_expensive_cache;
672672

673-
/* Reuse size, only used by SP local variable assignment, otherwize 0 */
673+
/* Reuse size, only used by SP local variable assignment, otherwise 0 */
674674
uint rsize;
675675

676676
protected:

sql/sql_insert.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2072,7 +2072,7 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
20722072

20732073

20742074
/******************************************************************************
2075-
Check that all fields with arn't null_fields are used
2075+
Check that there aren't any null_fields
20762076
******************************************************************************/
20772077

20782078

storage/connect/CMakeLists.txt

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ ELSE(NOT UNIX)
7373
tabwmi.cpp tabwmi.h tabmac.cpp tabmac.h macutil.cpp macutil.h)
7474
# Add exception handling to the CONNECT project)
7575
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
76+
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD")
77+
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd")
78+
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MD")
79+
SET(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MD")
7680
SET(IPHLPAPI_LIBRARY iphlpapi.lib)
7781
IF(MSVC AND (CMAKE_CXX_COMPILER_ID MATCHES Clang))
7882
# Connect does not work with clang-cl
@@ -118,7 +122,6 @@ IF(CONNECT_WITH_LIBXML2)
118122
FIND_PACKAGE(LibXml2)
119123
IF (LIBXML2_FOUND)
120124
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
121-
SET(ZLIB_LIBRARY "z") # see ZLIB_INCLUDE_DIR below
122125
SET(XML_LIBRARY ${LIBXML2_LIBRARIES})
123126
SET(CONNECT_SOURCES ${CONNECT_SOURCES} libdoc.cpp libdoc.h)
124127
add_definitions(-DLIBXML2_SUPPORT)
@@ -312,6 +315,30 @@ IF(CONNECT_WITH_MONGO)
312315
ENDIF(CONNECT_WITH_MONGO)
313316

314317

318+
#
319+
# REST
320+
#
321+
322+
OPTION(CONNECT_WITH_REST "Compile CONNECT storage engine with REST support" ON)
323+
324+
IF(CONNECT_WITH_REST)
325+
MESSAGE(STATUS "=====> REST support is ON")
326+
FIND_PACKAGE(cpprestsdk)
327+
IF (cpprestsdk_FOUND)
328+
MESSAGE(STATUS "=====> cpprestsdk found")
329+
IF(UNIX)
330+
# INCLUDE_DIRECTORIES(${CPPRESTSDK_INCLUDE_DIR})
331+
# If needed edit next line to set the path to libcpprest.so
332+
SET(REST_LIBRARY -lcpprest)
333+
MESSAGE (STATUS ${REST_LIBRARY})
334+
ENDIF(UNIX)
335+
SET(CONNECT_SOURCES ${CONNECT_SOURCES} tabrest.cpp restget.cpp tabrest.h)
336+
add_definitions(-DREST_SUPPORT)
337+
ELSE(NOT cpprestsdk_FOUND)
338+
MESSAGE(STATUS "=====> cpprestsdk package not found")
339+
ENDIF (cpprestsdk_FOUND)
340+
ENDIF(CONNECT_WITH_REST)
341+
315342
#
316343
# XMAP
317344
#
@@ -331,24 +358,16 @@ MYSQL_ADD_PLUGIN(connect ${CONNECT_SOURCES}
331358
COMPONENT connect-engine
332359
RECOMPILE_FOR_EMBEDDED
333360
LINK_LIBRARIES ${ZLIB_LIBRARY} ${XML_LIBRARY} ${ICONV_LIBRARY}
334-
${ODBC_LIBRARY} ${JDBC_LIBRARY} ${MONGOC_LIBRARY} ${IPHLPAPI_LIBRARY})
361+
${ODBC_LIBRARY} ${JDBC_LIBRARY} ${MONGOC_LIBRARY} ${IPHLPAPI_LIBRARY} ${REST_LIBRARY})
335362

336363
IF(NOT TARGET connect)
337364
RETURN()
338365
ENDIF()
339366

340-
# Don't link with bundled zlib and systel libxml2 at the same time.
341-
# System libxml2 uses system zlib, might conflict with the bundled one.
342-
IF (XML_LIBRARY AND BUILD_BUNDLED_ZLIB)
343-
GET_PROPERTY(INCS TARGET connect PROPERTY INCLUDE_DIRECTORIES)
344-
LIST(REMOVE_ITEM INCS ${ZLIB_INCLUDE_DIR})
345-
SET_PROPERTY(TARGET connect PROPERTY INCLUDE_DIRECTORIES ${INCS})
346-
ENDIF()
347-
348367
IF(WIN32)
349368
IF (libmongoc-1.0_FOUND)
350-
SET_TARGET_PROPERTIES(connect PROPERTIES LINK_FLAGS
351-
"/DELAYLOAD:libbson-1.0.dll /DELAYLOAD:libmongoc-1.0.dll")
369+
SET_TARGET_PROPERTIES(connect PROPERTIES LINK_FLAGS
370+
"/DELAYLOAD:libbson-1.0.dll /DELAYLOAD:libmongoc-1.0.dll")
352371
ENDIF(libmongoc-1.0_FOUND)
353372

354373
# Install some extra files that belong to connect engine
@@ -376,3 +395,4 @@ IF(CONNECT_WITH_JDBC AND JAVA_FOUND AND JNI_FOUND)
376395
${CMAKE_CURRENT_BINARY_DIR}/JdbcInterface.jar
377396
DESTINATION ${INSTALL_PLUGINDIR} COMPONENT connect-engine)
378397
ENDIF()
398+

storage/connect/array.cpp

Lines changed: 52 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/************* Array C++ Functions Source Code File (.CPP) *************/
22
/* Name: ARRAY.CPP Version 2.3 */
33
/* */
4-
/* (C) Copyright to the author Olivier BERTRAND 2005-2017 */
4+
/* (C) Copyright to the author Olivier BERTRAND 2005-2019 */
55
/* */
66
/* This file contains the XOBJECT derived class ARRAY functions. */
77
/* ARRAY is used for elaborate type of processing, such as sorting */
@@ -67,7 +67,7 @@ PARRAY MakeValueArray(PGLOBAL g, PPARM pp); // avoid gcc warning
6767
/* MakeValueArray: Makes a value array from a value list. */
6868
/***********************************************************************/
6969
PARRAY MakeValueArray(PGLOBAL g, PPARM pp)
70-
{
70+
{
7171
int n, valtyp = 0;
7272
size_t len = 0;
7373
PARRAY par;
@@ -82,8 +82,7 @@ PARRAY MakeValueArray(PGLOBAL g, PPARM pp)
8282
if ((valtyp = pp->Type) != TYPE_STRING)
8383
len = 1;
8484

85-
if (trace(1))
86-
htrc("valtyp=%d len=%d\n", valtyp, len);
85+
xtrc(1, "valtyp=%d len=%d\n", valtyp, len);
8786

8887
/*********************************************************************/
8988
/* Firstly check the list and count the number of values in it. */
@@ -127,13 +126,13 @@ PARRAY MakeValueArray(PGLOBAL g, PPARM pp)
127126
// Integer stored inside pp->Value
128127
par->AddValue(g, parmp->Intval);
129128
break;
130-
} // endswitch valtyp
129+
} // endswitch valtyp
131130

132131
/*********************************************************************/
133132
/* Send back resulting array. */
134133
/*********************************************************************/
135134
return par;
136-
} // end of MakeValueArray
135+
} // end of MakeValueArray
137136

138137
/* -------------------------- Class ARRAY ---------------------------- */
139138

@@ -151,6 +150,9 @@ ARRAY::ARRAY(PGLOBAL g, int type, int size, int length, int prec)
151150
Type = type;
152151
Xsize = -1;
153152
Len = 1;
153+
X = 0;
154+
Inf = 0;
155+
Sup = 0;
154156

155157
switch (type) {
156158
case TYPE_STRING:
@@ -281,130 +283,109 @@ void ARRAY::Empty(void)
281283
/* Add a string element to an array. */
282284
/***********************************************************************/
283285
bool ARRAY::AddValue(PGLOBAL g, PSZ strp)
284-
{
286+
{
285287
if (Type != TYPE_STRING) {
286288
sprintf(g->Message, MSG(ADD_BAD_TYPE), GetTypeName(Type), "CHAR");
287289
return true;
288-
} // endif Type
289-
290-
if (trace(1))
291-
htrc(" adding string(%d): '%s'\n", Nval, strp);
290+
} // endif Type
292291

293-
//Value->SetValue_psz(strp);
294-
//Vblp->SetValue(valp, Nval++);
292+
xtrc(1, " adding string(%d): '%s'\n", Nval, strp);
295293
Vblp->SetValue(strp, Nval++);
296294
return false;
297-
} // end of AddValue
295+
} // end of AddValue
298296

299297
/***********************************************************************/
300298
/* Add a char pointer element to an array. */
301299
/***********************************************************************/
302300
bool ARRAY::AddValue(PGLOBAL g, void *p)
303-
{
301+
{
304302
if (Type != TYPE_PCHAR) {
305303
sprintf(g->Message, MSG(ADD_BAD_TYPE), GetTypeName(Type), "PCHAR");
306304
return true;
307-
} // endif Type
308-
309-
if (trace(1))
310-
htrc(" adding pointer(%d): %p\n", Nval, p);
305+
} // endif Type
311306

307+
xtrc(1, " adding pointer(%d): %p\n", Nval, p);
312308
Vblp->SetValue((PSZ)p, Nval++);
313309
return false;
314-
} // end of AddValue
310+
} // end of AddValue
315311

316312
/***********************************************************************/
317313
/* Add a short integer element to an array. */
318314
/***********************************************************************/
319315
bool ARRAY::AddValue(PGLOBAL g, short n)
320-
{
316+
{
321317
if (Type != TYPE_SHORT) {
322318
sprintf(g->Message, MSG(ADD_BAD_TYPE), GetTypeName(Type), "SHORT");
323319
return true;
324-
} // endif Type
325-
326-
if (trace(1))
327-
htrc(" adding SHORT(%d): %hd\n", Nval, n);
320+
} // endif Type
328321

329-
//Value->SetValue(n);
330-
//Vblp->SetValue(valp, Nval++);
322+
xtrc(1, " adding SHORT(%d): %hd\n", Nval, n);
331323
Vblp->SetValue(n, Nval++);
332324
return false;
333-
} // end of AddValue
325+
} // end of AddValue
334326

335327
/***********************************************************************/
336328
/* Add an integer element to an array. */
337329
/***********************************************************************/
338330
bool ARRAY::AddValue(PGLOBAL g, int n)
339-
{
331+
{
340332
if (Type != TYPE_INT) {
341333
sprintf(g->Message, MSG(ADD_BAD_TYPE), GetTypeName(Type), "INTEGER");
342334
return true;
343-
} // endif Type
335+
} // endif Type
344336

345-
if (trace(1))
346-
htrc(" adding int(%d): %d\n", Nval, n);
347-
348-
//Value->SetValue(n);
349-
//Vblp->SetValue(valp, Nval++);
337+
xtrc(1, " adding int(%d): %d\n", Nval, n);
350338
Vblp->SetValue(n, Nval++);
351339
return false;
352-
} // end of AddValue
340+
} // end of AddValue
353341

354342
/***********************************************************************/
355343
/* Add a double float element to an array. */
356344
/***********************************************************************/
357345
bool ARRAY::AddValue(PGLOBAL g, double d)
358-
{
346+
{
359347
if (Type != TYPE_DOUBLE) {
360348
sprintf(g->Message, MSG(ADD_BAD_TYPE), GetTypeName(Type), "DOUBLE");
361349
return true;
362-
} // endif Type
363-
364-
if (trace(1))
365-
htrc(" adding float(%d): %lf\n", Nval, d);
350+
} // endif Type
366351

352+
xtrc(1, " adding float(%d): %lf\n", Nval, d);
367353
Value->SetValue(d);
368354
Vblp->SetValue(Value, Nval++);
369355
return false;
370-
} // end of AddValue
356+
} // end of AddValue
371357

372358
/***********************************************************************/
373359
/* Add the value of a XOBJECT block to an array. */
374360
/***********************************************************************/
375361
bool ARRAY::AddValue(PGLOBAL g, PXOB xp)
376-
{
377-
if (Type != xp->GetResultType()) {
378-
sprintf(g->Message, MSG(ADD_BAD_TYPE),
379-
GetTypeName(xp->GetResultType()), GetTypeName(Type));
380-
return true;
381-
} // endif Type
382-
383-
if (trace(1))
384-
htrc(" adding (%d) from xp=%p\n", Nval, xp);
362+
{
363+
if (Type != xp->GetResultType()) {
364+
sprintf(g->Message, MSG(ADD_BAD_TYPE),
365+
GetTypeName(xp->GetResultType()), GetTypeName(Type));
366+
return true;
367+
} // endif Type
385368

386-
//AddValue(xp->GetValue());
387-
Vblp->SetValue(xp->GetValue(), Nval++);
388-
return false;
389-
} // end of AddValue
369+
xtrc(1, " adding (%d) from xp=%p\n", Nval, xp);
370+
Vblp->SetValue(xp->GetValue(), Nval++);
371+
return false;
372+
} // end of AddValue
390373

391374
/***********************************************************************/
392375
/* Add a value to an array. */
393376
/***********************************************************************/
394377
bool ARRAY::AddValue(PGLOBAL g, PVAL vp)
395-
{
378+
{
396379
if (Type != vp->GetType()) {
397380
sprintf(g->Message, MSG(ADD_BAD_TYPE),
398381
GetTypeName(vp->GetType()), GetTypeName(Type));
399382
return true;
400-
} // endif Type
401-
402-
if (trace(1))
403-
htrc(" adding (%d) from vp=%p\n", Nval, vp);
383+
} // endif Type
404384

385+
xtrc(1, " adding (%d) from vp=%p\n", Nval, vp);
405386
Vblp->SetValue(vp, Nval++);
406387
return false;
407-
} // end of AddValue
388+
} // end of AddValue
408389

409390
/***********************************************************************/
410391
/* Retrieve the nth value of the array. */
@@ -973,7 +954,7 @@ int ARRAY::BlockTest(PGLOBAL, int opc, int opm,
973954
/* MakeArrayList: Makes a value list from an SQL IN array (in work). */
974955
/***********************************************************************/
975956
PSZ ARRAY::MakeArrayList(PGLOBAL g)
976-
{
957+
{
977958
char *p, *tp;
978959
int i;
979960
size_t z, len = 2;
@@ -988,11 +969,9 @@ PSZ ARRAY::MakeArrayList(PGLOBAL g)
988969
Value->SetValue_pvblk(Vblp, i);
989970
Value->Prints(g, tp, z);
990971
len += strlen(tp);
991-
} // enfor i
992-
993-
if (trace(1))
994-
htrc("Arraylist: len=%d\n", len);
972+
} // enfor i
995973

974+
xtrc(1, "Arraylist: len=%d\n", len);
996975
p = (char *)PlugSubAlloc(g, NULL, len);
997976
strcpy(p, "(");
998977

@@ -1001,19 +980,17 @@ PSZ ARRAY::MakeArrayList(PGLOBAL g)
1001980
Value->Prints(g, tp, z);
1002981
strcat(p, tp);
1003982
strcat(p, (++i == Nval) ? ")" : ",");
1004-
} // enfor i
1005-
1006-
if (trace(1))
1007-
htrc("Arraylist: newlen=%d\n", strlen(p));
983+
} // enfor i
1008984

985+
xtrc(1, "Arraylist: newlen=%d\n", strlen(p));
1009986
return p;
1010-
} // end of MakeArrayList
987+
} // end of MakeArrayList
1011988

1012989
/***********************************************************************/
1013990
/* Make file output of ARRAY contents. */
1014991
/***********************************************************************/
1015992
void ARRAY::Printf(PGLOBAL g, FILE *f, uint n)
1016-
{
993+
{
1017994
char m[64];
1018995
int lim = MY_MIN(Nval,10);
1019996

@@ -1035,19 +1012,19 @@ void ARRAY::Printf(PGLOBAL g, FILE *f, uint n)
10351012
} else
10361013
fprintf(f, "%sVALLST: numval=%d\n", m, Nval);
10371014

1038-
} // end of Printf
1015+
} // end of Printf
10391016

10401017
/***********************************************************************/
10411018
/* Make string output of ARRAY contents. */
10421019
/***********************************************************************/
10431020
void ARRAY::Prints(PGLOBAL, char *ps, uint z)
1044-
{
1021+
{
10451022
if (z < 16)
10461023
return;
10471024

10481025
sprintf(ps, "ARRAY: type=%d\n", Type);
10491026
// More to be implemented later
1050-
} // end of Prints
1027+
} // end of Prints
10511028

10521029
/* -------------------------- Class MULAR ---------------------------- */
10531030

0 commit comments

Comments
 (0)