Skip to content
Permalink
Browse files
In CONNECT version 1.6.10 NOSQL facility is enhanced by a new way to …
…retrieve NOSQL data.

In addition to files and Mongo collections, JSON as well as XML and CSV data can be retrieved
from the net as answers from REST queries. Because it uses and external package (cpprestsdk)
this is currently available only to MariaDB servers compiled from source.

-- Add the REST support when Microsoft Casablanca package (cpprestsdk) is installed.
-- Also include some changes specific to MariaDB 10.3.
  modified:   storage/connect/CMakeLists.txt

-- Add conditional REST support
-- Added string options HTTP and URI.
-- Added added internal table type TAB_REST.
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/mycat.cc
  modified:   storage/connect/mycat.h
  modified:   storage/connect/plgdbsem.h

-- Fix MDEV-19648 Variable connect_conv_size doesn't change
-- Change Variable wrong block parameter from 8169 to 1.
-- Also change connect_conv_size default value to 1024.
  modified:   storage/connect/ha_connect.cc

-- Avoid possible buffer overflow
-- In particular by the function ShowValue.
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabfmt.cpp
  modified:   storage/connect/value.cpp
  modified:   storage/connect/value.h

-- Add some cast to avoid some compiler warnings
  modified:   storage/connect/filamdbf.cpp

-- Fix some C++ error
  modified:   storage/connect/javaconn.cpp
  modified:   storage/connect/jmgoconn.cpp
  modified:   storage/connect/plugutil.cpp

-- Miscellaneous Typo and warning suppressing changes
  modified:   storage/connect/connect.cpp
  modified:   storage/connect/connect.h
  modified:   storage/connect/filamvct.cpp
  modified:   storage/connect/inihandl.cpp
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/libdoc.cpp
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabtbl.cpp
  modified:   storage/connect/tabxml.cpp
  modified:   storage/connect/user_connect.cc
  modified:   storage/connect/user_connect.h

-- Update failing test results and disbling
  modified:   storage/connect/mysql-test/connect/disabled.def
  modified:   storage/connect/mysql-test/connect/r/dir.result
  modified:   storage/connect/mysql-test/connect/r/grant.result
  modified:   storage/connect/mysql-test/connect/r/jdbc.result
  modified:   storage/connect/mysql-test/connect/r/jdbc_postgresql.result
  modified:   storage/connect/mysql-test/connect/r/xml.result
  modified:   storage/connect/mysql-test/connect/r/xml2.result
  modified:   storage/connect/mysql-test/connect/r/xml2_mult.result
  modified:   storage/connect/mysql-test/connect/r/xml_mult.result

-- Add an option
  modified:   storage/connect/mysql-test/connect/t/grant.test
  • Loading branch information
Buggynours committed Jun 27, 2019
1 parent 66197aa commit ec4795a
Show file tree
Hide file tree
Showing 38 changed files with 752 additions and 400 deletions.
@@ -11,7 +11,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA

SET(CONNECT_PLUGIN_STATIC "connect")
SET(CONNECT_PLUGIN_DYNAMIC "connect")
@@ -40,21 +40,26 @@ user_connect.h valblk.h value.h xindex.h xobject.h xtable.h)
add_definitions( -DMARIADB -DFORCE_INIT_OF_VARS -Dconnect_EXPORTS)
add_definitions( -DHUGE_SUPPORT -DGZ_SUPPORT )

macro(DISABLE_WARNING W)
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-error=${W}")
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-${W}" DEBUG)
endmacro()

#
# OS specific C flags, definitions and source files.
#
IF(UNIX)
MY_CHECK_AND_SET_COMPILER_FLAG("-Wall -Wmissing-declarations")
if(NOT WITH_WARNINGS)
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-unused-function")
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-unused-variable")
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-unused-value")
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-parentheses")
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-strict-aliasing")
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-misleading-indentation")
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-format-truncation")
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-implicit-fallthrough")
DISABLE_WARNING("unused-function")
DISABLE_WARNING("unused-variable")
DISABLE_WARNING("unused-value")
DISABLE_WARNING("parentheses")
DISABLE_WARNING("strict-aliasing")
DISABLE_WARNING("misleading-indentation")
DISABLE_WARNING("format-truncation")
DISABLE_WARNING("implicit-fallthrough")
DISABLE_WARNING("type-limits")
endif(NOT WITH_WARNINGS)

add_definitions( -DUNIX -DLINUX -DUBUNTU )
@@ -113,6 +118,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)
@@ -128,7 +134,6 @@ IF(WIN32)
OPTION(CONNECT_WITH_MSXML "Compile CONNECT storage engine with MSXML support" ON)
IF(CONNECT_WITH_MSXML)
add_definitions(-DMSX6 -DDOMDOC_SUPPORT)
message(STATUS "MSXML library version: msxml6")
SET(MSXML_FOUND 1)
SET(CONNECT_SOURCES ${CONNECT_SOURCES} domdoc.cpp domdoc.h)
ENDIF(CONNECT_WITH_MSXML)
@@ -168,7 +173,8 @@ IF(CONNECT_WITH_ODBC)
# the library 'libiodbc' gets compiled with 'sql'h.
# This will also need changes in the sources (e.g. #include <isql.h>).

find_path(ODBC_INCLUDE_DIR sql.h
find_file(ODBC_INCLUDES sql.h
PATHS
/usr/include
/usr/include/odbc
/usr/local/include
@@ -178,7 +184,7 @@ IF(CONNECT_WITH_ODBC)
#"C:/Program Files/Microsoft SDKs/Windows/v7.0A/include"
#"C:/Program Files/Microsoft SDKs/Windows/v6.0a/include"
#"C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/include"
DOC "Specify the directory containing sql.h."
DOC "Specify the path to sql.h."
)

find_library(ODBC_LIBRARY
@@ -197,9 +203,10 @@ IF(CONNECT_WITH_ODBC)
DOC "Specify the ODBC driver manager library here."
)

mark_as_advanced(ODBC_LIBRARY ODBC_INCLUDE_DIR)
mark_as_advanced(ODBC_LIBRARY ODBC_INCLUDES)

IF(ODBC_INCLUDE_DIR AND ODBC_LIBRARY)
IF(ODBC_INCLUDES AND ODBC_LIBRARY)
get_filename_component(ODBC_INCLUDE_DIR "${ODBC_INCLUDES}" PATH)
set(CMAKE_REQUIRED_LIBRARIES ${ODBC_LIBRARY})
set(CMAKE_REQUIRED_INCLUDES ${ODBC_INCLUDE_DIR})
CHECK_CXX_SOURCE_COMPILES(
@@ -305,6 +312,24 @@ IF(CONNECT_WITH_MONGO)
ENDIF(CONNECT_WITH_MONGO)


#
# REST
#

#OPTION(CONNECT_WITH_REST "Compile CONNECT storage engine with REST support" ON)

IF(CONNECT_WITH_REST)
MESSAGE(STATUS "=====> REST support is ON")
FIND_PACKAGE(cpprestsdk)
IF (cpprestsdk_FOUND)
MESSAGE(STATUS "=====> cpprestsdk found")
SET(CONNECT_SOURCES ${CONNECT_SOURCES} tabrest.cpp restget.cpp tabrest.h)
add_definitions(-DREST_SUPPORT)
ELSE(NOT cpprestsdk_FOUND)
MESSAGE(STATUS "=====> cpprestsdk package not found")
ENDIF (cpprestsdk_FOUND)
ENDIF(CONNECT_WITH_ZIP)

#
# XMAP
#
@@ -330,6 +355,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
@@ -338,14 +371,7 @@ IF(WIN32)

# Install some extra files that belong to connect engine

# install ha_connect.lib
GET_TARGET_PROPERTY(CONNECT_LOCATION connect LOCATION)
STRING(REPLACE "dll" "lib" CONNECT_LIB ${CONNECT_LOCATION})
IF(CMAKE_CONFIGURATION_TYPES)
STRING(REPLACE "${CMAKE_CFG_INTDIR}" "\${CMAKE_INSTALL_CONFIG_NAME}"
CONNECT_LIB ${CONNECT_LIB})
ENDIF()
INSTALL(FILES ${CONNECT_LIB}
INSTALL(FILES "$<TARGET_FILE_DIR:connect>/ha_connect.lib"
DESTINATION ${INSTALL_PLUGINDIR} COMPONENT connect-engine)
ENDIF(WIN32)

@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */

/***********************************************************************/
/* Author Olivier BERTRAND bertrandop@gmail.com 2004-2017 */
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */

/**************** Cnt H Declares Source Code File (.H) *****************/
/* Name: CONNECT.H Version 2.4 */
@@ -447,7 +447,7 @@ int DBFFAM::Cardinality(PGLOBAL g)

if (rln && Lrecl != rln) {
// This happens always on some Linux platforms
sprintf(g->Message, MSG(BAD_LRECL), Lrecl, rln);
sprintf(g->Message, MSG(BAD_LRECL), Lrecl, (ushort)rln);

if (Accept) {
Lrecl = rln;
@@ -967,7 +967,7 @@ int DBMFAM::Cardinality(PGLOBAL g)

if (rln && Lrecl != rln) {
// This happens always on some Linux platforms
sprintf(g->Message, MSG(BAD_LRECL), Lrecl, rln);
sprintf(g->Message, MSG(BAD_LRECL), Lrecl, (ushort)rln);

if (Accept) {
Lrecl = rln;
@@ -65,11 +65,6 @@
extern int num_read, num_there; // Statistics
static int num_write;

#if defined(UNIX)
// Add dummy strerror (NGC)
char *strerror(int num);
#endif // UNIX

/***********************************************************************/
/* Header containing block info for not split VEC tables. */
/* Block and last values can be calculated from NumRec and Nrec. */

0 comments on commit ec4795a

Please sign in to comment.