You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-07 02:42:49 +03:00
10.2 - integration fixes
- enable data truncation reporting for ps by default - added plugin protoype definitions to mysql.h10.2 - integration fixes
This commit is contained in:
@@ -50,7 +50,7 @@ IF(CURL_FOUND)
|
||||
IF(WIN32)
|
||||
REGISTER_PLUGIN("REMOTEIO" "${CMAKE_SOURCE_DIR}/plugins/io/remote_io.c" "remote_io_plugin" "DYNAMIC" "remote_io" 1)
|
||||
ELSE()
|
||||
REGISTER_PLUGIN("REMOTEIO" "${CMAKE_SOURCE_DIR}/plugins/io/remote_io.c" "remote_io_plugin" "DYNAMIC" "remote_io" 1)
|
||||
REGISTER_PLUGIN("REMOTEIO" "${CMAKE_SOURCE_DIR}/plugins/io/remote_io.c" "remote_io_plugin" "STATIC" "remote_io" 1)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
|
@@ -1,6 +1,8 @@
|
||||
SET(MARIADB_CLIENT_INCLUDES ${CMAKE_SOURCE_DIR}/include/mariadb_com.h
|
||||
${CMAKE_SOURCE_DIR}/include/mysql.h
|
||||
${CMAKE_SOURCE_DIR}/include/mariadb_stmt.h
|
||||
${CMAKE_SOURCE_DIR}/include/ma_pvio.h
|
||||
${CMAKE_SOURCE_DIR}/include/ma_ssl.h
|
||||
${CMAKE_SOURCE_DIR}/include/mariadb_version.h
|
||||
${CMAKE_SOURCE_DIR}/include/ma_list.h
|
||||
${CMAKE_SOURCE_DIR}/include/ma_errmsg.h
|
||||
|
@@ -414,6 +414,37 @@ typedef struct character_set
|
||||
|
||||
#include "mariadb_stmt.h"
|
||||
|
||||
#ifndef _have_client_plugin_declarations_
|
||||
#define _have_client_plugin_declarations_
|
||||
#define MYSQL_CLIENT_PLUGIN_HEADER \
|
||||
int type; \
|
||||
unsigned int interface_version; \
|
||||
const char *name; \
|
||||
const char *author; \
|
||||
const char *desc; \
|
||||
unsigned int version[3]; \
|
||||
const char *license; \
|
||||
int (*init)(char *, size_t, int, va_list); \
|
||||
int (*deinit)();
|
||||
struct st_mysql_client_plugin
|
||||
{
|
||||
MYSQL_CLIENT_PLUGIN_HEADER
|
||||
};
|
||||
|
||||
struct st_mysql_client_plugin * STDCALL
|
||||
mysql_load_plugin(struct st_mysql *mysql, const char *name, int type,
|
||||
int argc, ...);
|
||||
struct st_mysql_client_plugin * STDCALL
|
||||
mysql_load_plugin_v(struct st_mysql *mysql, const char *name, int type,
|
||||
int argc, va_list args);
|
||||
struct st_mysql_client_plugin * STDCALL
|
||||
mysql_client_find_plugin(struct st_mysql *mysql, const char *name, int type);
|
||||
struct st_mysql_client_plugin * STDCALL
|
||||
mysql_client_register_plugin(struct st_mysql *mysql,
|
||||
struct st_mysql_client_plugin *plugin);
|
||||
#endif
|
||||
|
||||
|
||||
void STDCALL mysql_set_local_infile_handler(MYSQL *mysql,
|
||||
int (*local_infile_init)(void **, const char *, void *),
|
||||
int (*local_infile_read)(void *, char *, unsigned int),
|
||||
|
@@ -102,9 +102,6 @@ typedef struct st_ma_connection_plugin
|
||||
|
||||
/******************* Communication IO plugin *****************/
|
||||
#include <ma_pvio.h>
|
||||
#ifdef HAVE_SSL
|
||||
#include <ma_ssl.h>
|
||||
#endif
|
||||
|
||||
typedef struct st_mariadb_client_plugin_PVIO
|
||||
{
|
||||
|
@@ -359,7 +359,8 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||
TARGET_LINK_LIBRARIES (mariadbclient "-Wl,--version-script=${CMAKE_BINARY_DIR}/libmariadb/mariadbclient.def")
|
||||
ENDIF()
|
||||
|
||||
SET_TARGET_PROPERTIES(mariadbclient PROPERTIES INTERFACE_LINK_LIBRARIES "${SYSTEM_LIBS}")
|
||||
SET_TARGET_PROPERTIES(mariadbclient PROPERTIES IMPORTED_INTERFACE_LINK_LIBRARIES "${SYSTEM_LIBS}")
|
||||
SET_TARGET_PROPERTIES(libmariadb PROPERTIES IMPORTED_INTERFACE_LINK_LIBRARIES "${SYSTEM_LIBS}")
|
||||
|
||||
SET_TARGET_PROPERTIES(libmariadb PROPERTIES PREFIX "")
|
||||
|
||||
|
@@ -66,10 +66,11 @@ int mysql_local_infile_init(void **ptr, const char *filename, void *userdata)
|
||||
MYSQL_INFILE_INFO *info;
|
||||
MYSQL *mysql= (MYSQL *)userdata;
|
||||
|
||||
info = (MYSQL_INFILE_INFO *)calloc(1, sizeof(MYSQL_INFILE_INFO));
|
||||
info = (MYSQL_INFILE_INFO *)malloc(sizeof(MYSQL_INFILE_INFO));
|
||||
if (!info) {
|
||||
return(1);
|
||||
}
|
||||
memset(info, 0, sizeof(MYSQL_INFILE_INFO));
|
||||
*ptr = info;
|
||||
|
||||
info->filename = filename;
|
||||
|
@@ -939,6 +939,7 @@ mysql_init(MYSQL *mysql)
|
||||
}
|
||||
else
|
||||
memset((char*) (mysql), 0, sizeof(*(mysql)));
|
||||
mysql->options.report_data_truncation= 1;
|
||||
mysql->options.connect_timeout=CONNECT_TIMEOUT;
|
||||
mysql->charset= ma_default_charset_info;
|
||||
mysql->methods= &MARIADB_DEFAULT_METHODS;
|
||||
@@ -3104,12 +3105,12 @@ my_ulonglong STDCALL mysql_insert_id(MYSQL *mysql)
|
||||
|
||||
uint STDCALL mysql_errno(MYSQL *mysql)
|
||||
{
|
||||
return (mysql)->net.last_errno;
|
||||
return mysql ? mysql->net.last_errno : 0;
|
||||
}
|
||||
|
||||
char * STDCALL mysql_error(MYSQL *mysql)
|
||||
{
|
||||
return (mysql)->net.last_error;
|
||||
return mysql ? (mysql)->net.last_error : "";
|
||||
}
|
||||
|
||||
char *STDCALL mysql_info(MYSQL *mysql)
|
||||
|
Reference in New Issue
Block a user