You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-08 14:02:17 +03:00
- Fixed build errors for remote_io plugin
- Bumped client version number to 10.1.7
This commit is contained in:
@@ -28,7 +28,7 @@ IF(CMAKE_VERSION VERSION_GREATER "2.9.9")
|
|||||||
CMAKE_POLICY(SET CMP0045 OLD)
|
CMAKE_POLICY(SET CMP0045 OLD)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
SET(MARIADB_CONNECTOR_C_COPYRIGHT "2013-2015 MariaDB Corporation Ab")
|
SET(MARIADB_CONNECTOR_C_COPYRIGHT "2013-2016 MariaDB Corporation Ab")
|
||||||
|
|
||||||
### Options ###
|
### Options ###
|
||||||
IF(NOT WIN32)
|
IF(NOT WIN32)
|
||||||
@@ -37,7 +37,6 @@ ELSE()
|
|||||||
OPTION(WITH_SIGNCODE "digitally sign files" OFF)
|
OPTION(WITH_SIGNCODE "digitally sign files" OFF)
|
||||||
OPTION(WITH_RTC "enables run time checks for debug builds" OFF)
|
OPTION(WITH_RTC "enables run time checks for debug builds" OFF)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
OPTION(WITH_REMOTEIO "enables remote io support (requires libcurl)" OFF)
|
|
||||||
|
|
||||||
OPTION(WITH_EXTERNAL_ZLIB "Enables use of external zlib" OFF)
|
OPTION(WITH_EXTERNAL_ZLIB "Enables use of external zlib" OFF)
|
||||||
###############
|
###############
|
||||||
@@ -53,6 +52,11 @@ IF(WITH_RTC)
|
|||||||
SET(RTC_OPTIONS "/RTC1 /RTCc")
|
SET(RTC_OPTIONS "/RTC1 /RTCc")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
INCLUDE(FindCURL)
|
||||||
|
IF(CURL_FOUND)
|
||||||
|
ADD_DEFINITIONS(-DHAVE_CURL=1)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/plugins.cmake)
|
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/plugins.cmake)
|
||||||
|
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
@@ -101,9 +105,9 @@ ENDIF()
|
|||||||
# various defines for generating include/mysql_version.h
|
# various defines for generating include/mysql_version.h
|
||||||
|
|
||||||
SET(PROTOCOL_VERSION 10) # we adapted new password option from PHP's mysqlnd !
|
SET(PROTOCOL_VERSION 10) # we adapted new password option from PHP's mysqlnd !
|
||||||
SET(MYSQL_CLIENT_VERSION_MAJOR "5")
|
SET(MYSQL_CLIENT_VERSION_MAJOR "10")
|
||||||
SET(MYSQL_CLIENT_VERSION_MINOR "5")
|
SET(MYSQL_CLIENT_VERSION_MINOR "1")
|
||||||
SET(MYSQL_CLIENT_VERSION_PATCH "2")
|
SET(MYSQL_CLIENT_VERSION_PATCH "7")
|
||||||
SET(MYSQL_CLIENT_VERSION "${MYSQL_CLIENT_VERSION_MAJOR}.${MYSQL_CLIENT_VERSION_MINOR}.${MYSQL_CLIENT_VERSION_PATCH}")
|
SET(MYSQL_CLIENT_VERSION "${MYSQL_CLIENT_VERSION_MAJOR}.${MYSQL_CLIENT_VERSION_MINOR}.${MYSQL_CLIENT_VERSION_PATCH}")
|
||||||
MATH(EXPR MYSQL_VERSION_ID "${MYSQL_CLIENT_VERSION_MAJOR} * 10000 +
|
MATH(EXPR MYSQL_VERSION_ID "${MYSQL_CLIENT_VERSION_MAJOR} * 10000 +
|
||||||
${MYSQL_CLIENT_VERSION_MINOR} * 100 +
|
${MYSQL_CLIENT_VERSION_MINOR} * 100 +
|
||||||
@@ -133,17 +137,15 @@ ENDIF()
|
|||||||
|
|
||||||
|
|
||||||
IF(UNIX)
|
IF(UNIX)
|
||||||
SEARCH_LIBRARY(LIBNSL inet_ntoa "nsl_r;nsl")
|
|
||||||
SEARCH_LIBRARY(LIBBIND bind "bind;socket")
|
|
||||||
SEARCH_LIBRARY(LIBSOCKET setsockopt "socket")
|
|
||||||
SEARCH_LIBRARY(LIBDL dlopen "dl")
|
SEARCH_LIBRARY(LIBDL dlopen "dl")
|
||||||
SEARCH_LIBRARY(LIBM floor m)
|
SEARCH_LIBRARY(LIBM floor m)
|
||||||
# SEARCH_LIBRARY(LIBICONV iconv iconv)
|
|
||||||
SEARCH_LIBRARY(LIBPTHREAD pthread_getspecific "pthread;pthreads")
|
SEARCH_LIBRARY(LIBPTHREAD pthread_getspecific "pthread;pthreads")
|
||||||
SET(EXTRA_LIBS "${LIBNSL}" "${LIBBIND}" "${LIBSOCKET}")
|
|
||||||
FIND_PACKAGE(Threads)
|
FIND_PACKAGE(Threads)
|
||||||
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${LIBNSL} ${LIBBIND} ${LIBICONV}
|
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${LIBNSL} ${LIBBIND} ${LIBICONV}
|
||||||
${LIBSOCKET} ${LIBDL} ${LIBM} ${LIBPTHREAD})
|
${LIBSOCKET} ${LIBDL} ${LIBM} ${LIBPTHREAD})
|
||||||
|
SET(SYSTEM_LIBS ${LIBNSL} ${LIBBIND} ${LIBICONV}
|
||||||
|
${LIBSOCKET} ${LIBDL} ${LIBM} ${LIBPTHREAD})
|
||||||
|
MESSAGE(STATUS "SYSTEM_LIBS ${SYSTEM_LIBS}")
|
||||||
#remove possible dups from required libraries
|
#remove possible dups from required libraries
|
||||||
LIST(LENGTH CMAKE_REQUIRED_LIBRARIES rllength)
|
LIST(LENGTH CMAKE_REQUIRED_LIBRARIES rllength)
|
||||||
IF(${rllength} GREATER 0)
|
IF(${rllength} GREATER 0)
|
||||||
@@ -178,7 +180,7 @@ INCLUDE(${CMAKE_SOURCE_DIR}/cmake/CheckFunctions.cmake)
|
|||||||
# check for various types
|
# check for various types
|
||||||
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/CheckTypes.cmake)
|
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/CheckTypes.cmake)
|
||||||
|
|
||||||
IF(NOT WITH_SSL)
|
IF(NOT WITH_SSL AND NOT WITH_SSL STREQUAL "OFF")
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
SET(WITH_SSL "SCHANNEL")
|
SET(WITH_SSL "SCHANNEL")
|
||||||
ELSE()
|
ELSE()
|
||||||
@@ -245,7 +247,15 @@ ENDIF()
|
|||||||
IF(WITH_SSL)
|
IF(WITH_SSL)
|
||||||
SET(SYSTEM_LIBS ${SYSTEM_LIBS} ${SSL_LIBRARIES})
|
SET(SYSTEM_LIBS ${SYSTEM_LIBS} ${SSL_LIBRARIES})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
MARK_AS_ADVANCED(SYSTEM_LIBS)
|
||||||
|
|
||||||
|
IF(NOT REMOTEIO_PLUGIN_TYPE MATCHES "OFF")
|
||||||
|
INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIRS})
|
||||||
|
IF(REMOTEIO_PLUGIN_TYPE MATCHES "STATIC")
|
||||||
|
SET(SYSTEM_LIBS ${SYSTEM_LIBS} ${CURL_LIBRARIES})
|
||||||
|
ENDIF()
|
||||||
|
ADD_DEFINITIONS("-DHAVE_REMOTEIO=1")
|
||||||
|
ENDIF()
|
||||||
ADD_SUBDIRECTORY(include)
|
ADD_SUBDIRECTORY(include)
|
||||||
ADD_SUBDIRECTORY(libmariadb)
|
ADD_SUBDIRECTORY(libmariadb)
|
||||||
ADD_SUBDIRECTORY(plugins)
|
ADD_SUBDIRECTORY(plugins)
|
||||||
|
@@ -15,7 +15,7 @@ ELSE()
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
find_library(ICONV_LIBRARIES NAMES iconv libiconv c PATHS
|
find_library(ICONV_LIBRARIES NAMES iconv libiconv PATHS
|
||||||
/opt/local/lib/
|
/opt/local/lib/
|
||||||
/usr/lib/
|
/usr/lib/
|
||||||
NO_CMAKE_SYSTEM_PATH)
|
NO_CMAKE_SYSTEM_PATH)
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
MACRO(REGISTER_PLUGIN name source struct type target allow)
|
MACRO(REGISTER_PLUGIN name source struct type target allow)
|
||||||
SET(PLUGIN_TYPE ${${name}})
|
SET(PLUGIN_TYPE ${${name}})
|
||||||
IF(NOT PLUGIN_TYPE STREQUAL "OFF")
|
IF(NOT PLUGIN_TYPE STREQUAL "OFF" AND NOT PLUGIN_TYPE)
|
||||||
SET(PLUGIN_TYPE ${type})
|
SET(PLUGIN_TYPE ${type})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
IF(PLUGINS)
|
IF(PLUGINS)
|
||||||
@@ -18,6 +18,7 @@ MACRO(REGISTER_PLUGIN name source struct type target allow)
|
|||||||
SET(${name}_PLUGIN_SOURCE ${source})
|
SET(${name}_PLUGIN_SOURCE ${source})
|
||||||
SET(${name}_PLUGIN_CHG ${allow})
|
SET(${name}_PLUGIN_CHG ${allow})
|
||||||
SET(PLUGINS ${PLUGINS} "${name}")
|
SET(PLUGINS ${PLUGINS} "${name}")
|
||||||
|
ADD_DEFINITIONS(-DHAVE_${name}=1)
|
||||||
ENDMACRO()
|
ENDMACRO()
|
||||||
|
|
||||||
MARK_AS_ADVANCED(PLUGINS)
|
MARK_AS_ADVANCED(PLUGINS)
|
||||||
|
@@ -85,6 +85,7 @@ extern const char *mariadb_client_errors[]; /* Error messages */
|
|||||||
#define CR_EVENT_CREATE_FAILED 5000
|
#define CR_EVENT_CREATE_FAILED 5000
|
||||||
#define CR_BIND_ADDR_FAILED 5001
|
#define CR_BIND_ADDR_FAILED 5001
|
||||||
#define CR_ASYNC_NOT_SUPPORTED 5002
|
#define CR_ASYNC_NOT_SUPPORTED 5002
|
||||||
|
#define CR_FUNCTION_NOT_SUPPORTED 5003
|
||||||
|
|
||||||
#define SQLSTATE_UNKNOWN "HY000"
|
#define SQLSTATE_UNKNOWN "HY000"
|
||||||
|
|
||||||
|
@@ -151,11 +151,11 @@ typedef char *(*mysql_authentication_dialog_ask_t)(struct st_mysql *mysql,
|
|||||||
#include <mariadb/ma_io.h>
|
#include <mariadb/ma_io.h>
|
||||||
|
|
||||||
/* Remote IO plugin */
|
/* Remote IO plugin */
|
||||||
struct st_mysql_client_plugin_REMOTEIO
|
typedef struct st_mysql_client_plugin_REMOTEIO
|
||||||
{
|
{
|
||||||
MYSQL_CLIENT_PLUGIN_HEADER
|
MYSQL_CLIENT_PLUGIN_HEADER
|
||||||
struct st_rio_methods *methods;
|
struct st_rio_methods *methods;
|
||||||
};
|
} MARIADB_REMOTEIO_PLUGIN;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/******** using plugins ************/
|
/******** using plugins ************/
|
||||||
|
@@ -402,7 +402,7 @@ ENDIF()
|
|||||||
|
|
||||||
ADD_LIBRARY(mariadbclient STATIC ${ariadbclient_RC} $<TARGET_OBJECTS:mariadb_obj> ${EMPTY_FILE} ${EXPORT_LINK})
|
ADD_LIBRARY(mariadbclient STATIC ${ariadbclient_RC} $<TARGET_OBJECTS:mariadb_obj> ${EMPTY_FILE} ${EXPORT_LINK})
|
||||||
TARGET_LINK_LIBRARIES(mariadbclient ${SYSTEM_LIBS})
|
TARGET_LINK_LIBRARIES(mariadbclient ${SYSTEM_LIBS})
|
||||||
|
MESSAGE(STATUS "SYSLIBS: ${SYSTEM_LIBS}")
|
||||||
ADD_LIBRARY(libmariadb SHARED ${libmariadb_RC} $<TARGET_OBJECTS:mariadb_obj> ${EMPTY_FILE} ${EXPORT_LINK})
|
ADD_LIBRARY(libmariadb SHARED ${libmariadb_RC} $<TARGET_OBJECTS:mariadb_obj> ${EMPTY_FILE} ${EXPORT_LINK})
|
||||||
TARGET_LINK_LIBRARIES(libmariadb ${SYSTEM_LIBS})
|
TARGET_LINK_LIBRARIES(libmariadb ${SYSTEM_LIBS})
|
||||||
IF(UNIX)
|
IF(UNIX)
|
||||||
|
@@ -150,6 +150,7 @@ const char *mariadb_client_errors[] =
|
|||||||
/* 5000 */ "Creating an event failed (Errorcode: %d)",
|
/* 5000 */ "Creating an event failed (Errorcode: %d)",
|
||||||
/* 5001 */ "Bind to local interface '-.%64s' failed (Errorcode: %d)",
|
/* 5001 */ "Bind to local interface '-.%64s' failed (Errorcode: %d)",
|
||||||
/* 5002 */ "Connection type doesn't support asynchronous IO operations",
|
/* 5002 */ "Connection type doesn't support asynchronous IO operations",
|
||||||
|
/* 5003 */ "Server doesn't support function '%s'",
|
||||||
""
|
""
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -3691,7 +3691,7 @@ my_bool STDCALL mariadb_get_infov(MYSQL *mysql, enum mariadb_value value, void *
|
|||||||
goto error;
|
goto error;
|
||||||
break;
|
break;
|
||||||
case MARIADB_CONNECTION_PVIO_TYPE:
|
case MARIADB_CONNECTION_PVIO_TYPE:
|
||||||
if (mysql && !mysql->net.pvio)
|
if (mysql && mysql->net.pvio)
|
||||||
*((unsigned int *)arg)= (unsigned int)mysql->net.pvio->type;
|
*((unsigned int *)arg)= (unsigned int)mysql->net.pvio->type;
|
||||||
else
|
else
|
||||||
goto error;
|
goto error;
|
||||||
|
@@ -2,26 +2,32 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
|
|||||||
|
|
||||||
# Figure out additional libraries for use with
|
# Figure out additional libraries for use with
|
||||||
|
|
||||||
FOREACH (dep ${libmariadb_LIB_DEPENDS})
|
FUNCTION(GET_LIB_NAME LIB_NAME LIB_OUT)
|
||||||
STRING(REGEX MATCH "^-l.*$" out "${dep}")
|
STRING(FIND ${LIB_NAME} ".so" IS_SO)
|
||||||
IF(out)
|
IF(NOT ${IS_SO} STREQUAL "-1")
|
||||||
SET(extra_dynamic_LDFLAGS "${extra_dynamic_LDFLAGS} ${dep}")
|
GET_FILENAME_COMPONENT(LIB_FILE ${LIB_NAME} NAME_WE)
|
||||||
ENDIF(out)
|
ELSE()
|
||||||
ENDFOREACH(dep)
|
SET(LIB_FILE ${LIB_NAME})
|
||||||
|
ENDIF()
|
||||||
|
SET(LIB_FILE "-l${LIB_FILE}")
|
||||||
|
STRING(REPLACE "-llib" "-l" LIB_FILE ${LIB_FILE})
|
||||||
|
SET(${LIB_OUT} ${LIB_FILE} PARENT_SCOPE)
|
||||||
|
ENDFUNCTION()
|
||||||
|
|
||||||
|
LIST(LENGTH SYSTEM_LIBS rllength)
|
||||||
|
IF(${rllength} GREATER 0)
|
||||||
|
LIST(REMOVE_DUPLICATES SYSTEM_LIBS)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
FOREACH (LIB_NAME ${SYSTEM_LIBS})
|
||||||
|
GET_LIB_NAME(${LIB_NAME} LIB_OUT)
|
||||||
|
SET(extra_dynamic_LDFLAGS "${extra_dynamic_LDFLAGS} ${LIB_OUT}")
|
||||||
|
ENDFOREACH()
|
||||||
|
|
||||||
IF(UNIX)
|
IF(UNIX)
|
||||||
IF(OPENSSL_LIBRARIES)
|
|
||||||
SET(extra_dynamic_LDFLAGS "${extra_dynamic_LDFLAGS} -lssl")
|
|
||||||
ENDIF()
|
|
||||||
IF(ICONV_EXTERNAL)
|
IF(ICONV_EXTERNAL)
|
||||||
SET(extra_dynamic_LDFLAGS "${extra_dynamic_LDFLAGS} ${ICONV_LIBRARIES}")
|
SET(extra_dynamic_LDFLAGS "${extra_dynamic_LDFLAGS} ${ICONV_LIBRARIES}")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
FOREACH(lib ${EXTRA_LIBS})
|
|
||||||
SET(extra_dynamic_LDFLAGS "${extra_dynamic_LDFLAGS} -l${lib}")
|
|
||||||
ENDFOREACH()
|
|
||||||
IF(WITH_SQLITE)
|
|
||||||
SET(extra_dynamic_LDFLAGS "${extra_dynamic_LDFLAGS} -lsqlite")
|
|
||||||
ENDIF()
|
|
||||||
ENDIF(UNIX)
|
ENDIF(UNIX)
|
||||||
|
|
||||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mariadb_config.c.in
|
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mariadb_config.c.in
|
||||||
|
@@ -17,6 +17,7 @@ IF(REMOTEIO_PLUGIN_TYPE MATCHES "DYNAMIC")
|
|||||||
# remote file plugin
|
# remote file plugin
|
||||||
INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR})
|
INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR})
|
||||||
SET(REMOTE_IO_SOURCES ${remote_io_RC} remote_io.c)
|
SET(REMOTE_IO_SOURCES ${remote_io_RC} remote_io.c)
|
||||||
|
ADD_DEFINITIONS(-DHAVE_REMOTEIO_DYNAMIC=1)
|
||||||
ADD_LIBRARY(remote_io SHARED ${REMOTE_IO_SOURCES} ${CMAKE_SOURCE_DIR}/plugins/plugin.def)
|
ADD_LIBRARY(remote_io SHARED ${REMOTE_IO_SOURCES} ${CMAKE_SOURCE_DIR}/plugins/plugin.def)
|
||||||
TARGET_LINK_LIBRARIES(remote_io ${CURL_LIBRARIES})
|
TARGET_LINK_LIBRARIES(remote_io ${CURL_LIBRARIES})
|
||||||
SET_TARGET_PROPERTIES(remote_io PROPERTIES PREFIX "")
|
SET_TARGET_PROPERTIES(remote_io PROPERTIES PREFIX "")
|
||||||
|
@@ -43,7 +43,6 @@
|
|||||||
smb://
|
smb://
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CURL
|
|
||||||
#include <my_global.h>
|
#include <my_global.h>
|
||||||
#include <my_sys.h>
|
#include <my_sys.h>
|
||||||
#include <mysql.h>
|
#include <mysql.h>
|
||||||
@@ -58,6 +57,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <mariadb/ma_io.h>
|
||||||
|
|
||||||
/* Internal file structure */
|
/* Internal file structure */
|
||||||
|
|
||||||
@@ -89,11 +89,10 @@ typedef struct
|
|||||||
|
|
||||||
CURLM *multi_handle= NULL;
|
CURLM *multi_handle= NULL;
|
||||||
|
|
||||||
#ifndef HAVE_REMOTE_IO_DYNAMIC
|
#ifndef HAVE_REMOTEIO_DYNAMIC
|
||||||
struct st_mysql_client_plugin remote_io_plugin=
|
MARIADB_REMOTEIO_PLUGIN remote_io_plugin=
|
||||||
{
|
|
||||||
#else
|
#else
|
||||||
struct st_mysql_client_plugin _mysql_client_plugin_declare_ =
|
MARIADB_REMOTEIO_PLUGIN _mysql_client_plugin_declare_ =
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
MARIADB_CLIENT_REMOTEIO_PLUGIN,
|
MARIADB_CLIENT_REMOTEIO_PLUGIN,
|
||||||
@@ -439,4 +438,3 @@ char *ma_rio_gets(char *ptr, size_t size, MA_FILE *file)
|
|||||||
|
|
||||||
return ptr;/*success */
|
return ptr;/*success */
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
Reference in New Issue
Block a user