diff --git a/include/CommonHelper.h b/include/CommonHelper.h index 3a0c2e5..f694e07 100644 --- a/include/CommonHelper.h +++ b/include/CommonHelper.h @@ -106,6 +106,8 @@ //#define CPI_UTF32 12000 #define CPI_CP932 932 +#define MYSQL_TYPE_JSON 245 +#define FIELD_TYPE_JSON MYSQL_TYPE_JSON typedef struct ForeignKey diff --git a/include/Version.h b/include/Version.h index 34ba528..8df3595 100644 --- a/include/Version.h +++ b/include/Version.h @@ -1,5 +1,5 @@ #define MAJOR_VERSION_INT 12 #define MINOR_VERSION_INT 2 -#define UPDATE_VERSION_INT 4 +#define UPDATE_VERSION_INT 6 #define RELEASE_VERSION_INT 0 #define EXTRAINFO "" diff --git a/include/mysql/Makefile.am b/include/mysql/Makefile.am new file mode 100644 index 0000000..50976c7 --- /dev/null +++ b/include/mysql/Makefile.am @@ -0,0 +1,30 @@ +# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +# MA 02111-1307, USA + +BUILT_SOURCES = mysql_version.h my_config.h +pkginclude_HEADERS = dbug.h m_string.h my_sys.h mysql.h mysql_com.h \ + mysqld_error.h my_list.h m_ctype.h \ + my_pthread.h my_no_pthread.h errmsg.h \ + my_global.h my_net.h \ + $(BUILT_SOURCES) +noinst_HEADERS = config-win.h \ + my_dir.h mysys_err.h \ + my_alarm.h \ + hash.h thr_alarm.h \ + getopt.h violite.h \ + mysql_version.h.in + diff --git a/include/mysql/config-win.h b/include/mysql/config-win.h index 97015d6..1869993 100644 --- a/include/mysql/config-win.h +++ b/include/mysql/config-win.h @@ -1,272 +1,277 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA */ - -/* Defines for Win32 to make it compatible for MySQL */ - -#ifndef _config_win_h_ -#define _config_win_h_ - -#include -#include -#include -#include /* Because of rint() */ -#include -#include -#include -#include -#include - -#ifndef THREAD - #define THREAD -#endif - -#ifdef _WIN64 -#define MACHINE_TYPE "ia64" /* Define to machine type name */ -#else -#define MACHINE_TYPE "i32" /* Define to machine type name */ -#endif /* _WIN64 */ - -/* File and lock constants */ -#define O_SHARE 0x1000 /* Open file in sharing mode */ -#ifdef __BORLANDC__ -#define F_RDLCK LK_NBLCK /* read lock */ -#define F_WRLCK LK_NBRLCK /* write lock */ -#define F_UNLCK LK_UNLCK /* remove lock(s) */ -#else -#define F_RDLCK _LK_NBLCK /* read lock */ -#define F_WRLCK _LK_NBRLCK /* write lock */ -#define F_UNLCK _LK_UNLCK /* remove lock(s) */ -#endif - -#define F_EXCLUSIVE 1 /* We have only exclusive locking */ -#define F_TO_EOF (INT_MAX32/2) /* size for lock of all file */ -#define F_OK 0 /* parameter to access() */ - -#define S_IROTH S_IREAD /* for my_lib */ - -#ifdef __BORLANDC__ -#define FILE_BINARY O_BINARY /* my_fopen in binary mode */ -#define O_TEMPORARY 0 -#define O_SHORT_LIVED 0 -#define SH_DENYNO _SH_DENYNO -#else -#define O_BINARY _O_BINARY /* compability with MSDOS */ -#define FILE_BINARY _O_BINARY /* my_fopen in binary mode */ -#define O_TEMPORARY _O_TEMPORARY -#define O_SHORT_LIVED _O_SHORT_LIVED -#define SH_DENYNO _SH_DENYNO -#endif -#define NO_OPEN_3 /* For my_create() */ - -#define SIGQUIT SIGTERM /* No SIGQUIT */ - -#undef _REENTRANT /* Crashes something for win32 */ -#undef SAFE_MUTEX /* Can't be used on windows */ - -#define LONGLONG_MIN ((__int64) 0x8000000000000000) -#define LONGLONG_MAX ((__int64) 0x7FFFFFFFFFFFFFFF) -#define LL(A) ((__int64) A) - -/* Type information */ - -typedef unsigned short ushort; -typedef unsigned int uint; -typedef unsigned __int64 ulonglong; /* Microsofts 64 bit types */ -typedef __int64 longlong; -typedef int sigset_t; -#define longlong_defined -/* off_t should not be __int64 because of conflicts in header files; - Use my_off_t or os_off_t instead */ -typedef long off_t; -typedef __int64 os_off_t; -#ifdef _WIN64 -typedef UINT_PTR rf_SetTimer; -#else -typedef uint rf_SetTimer; -#endif - -#define Socket_defined -#define my_socket SOCKET -#define bool BOOL -#define SIGPIPE SIGINT -#define RETQSORTTYPE void -#define QSORT_TYPE_IS_VOID -#define RETSIGTYPE void -#define SOCKET_SIZE_TYPE int -#define my_socket_defined -#define bool_defined -#define byte_defined -#define HUGE_PTR -#define STDCALL __stdcall /* Used by libmariadb.dll */ - -#define VOID_SIGHANDLER -#define SIZEOF_CHAR 1 -#define SIZEOF_LONG 4 -#define SIZEOF_LONG_LONG 8 -#define SIZEOF_OFF_T 8 -#define HAVE_BROKEN_NETINET_INCLUDES -#ifdef __NT__ -#define HAVE_NAMED_PIPE /* We can only create pipes on NT */ -#endif - -/* Use all character sets in MySQL */ -#define USE_MB 1 -#define USE_MB_IDENT 1 -#define USE_STRCOLL 1 - -/* Convert some simple functions to Posix */ - -#define sigset(A,B) signal((A),(B)) -#define finite(A) _finite(A) -#define sleep(A) Sleep((A)*1000) - -#ifndef __BORLANDC__ -#define access(A,B) _access(A,B) -#endif - -#if defined(__cplusplus) - -inline double rint(double nr) -{ - double f = floor(nr); - double c = ceil(nr); - return (((c-nr) >= (nr-f)) ? f :c); -} - -#ifdef _WIN64 -#define ulonglong2double(A) ((double) (A)) -#define my_off_t2double(A) ((double) (A)) - -#else -inline double ulonglong2double(ulonglong value) -{ - longlong nr=(longlong) value; - if (nr >= 0) - return (double) nr; - return (18446744073709551616.0 + (double) nr); -} -#define my_off_t2double(A) ulonglong2double(A) -#endif /* _WIN64 */ -#else -#define inline __inline -#endif /* __cplusplus */ - -#define __attribute(A) - -#if SIZEOF_OFF_T > 4 -#define lseek(A,B,C) _lseeki64((A),(longlong) (B),(C)) -#define tell(A) _telli64(A) -#endif - -#define STACK_DIRECTION -1 - -/* redefine deprecated functions -#define sprintf sprintf_s -#define strcpy strcpy_s -#define strcat strcat_s -#define fopen fopen_r -#define freopen freopen_r -#define getenv _dupenv_s -*/ -#ifdef _WIN32 -#include -#endif - -#define HAVE_PERROR -#define HAVE_VFPRINT -#define HAVE_CHSIZE /* System has chsize() function */ -#define HAVE_RENAME /* Have rename() as function */ -#define HAVE_BINARY_STREAMS /* Have "b" flag in streams */ -#define HAVE_LONG_JMP /* Have long jump function */ -#define HAVE_LOCKING /* have locking() call */ -#define HAVE_ERRNO_AS_DEFINE /* errno is a define */ -#define HAVE_STDLIB /* everything is include in this file */ -#define HAVE_MEMCPY -#define HAVE_MEMMOVE -#define HAVE_GETCWD -#define HAVE_TELL -#define HAVE_TZNAME -#define HAVE_PUTENV -#define HAVE_SELECT -#define HAVE_SETLOCALE -#define HAVE_SOCKET /* Giangi */ -#define HAVE_FLOAT_H -#define HAVE_LIMITS_H -#define HAVE_STDDEF_H -#define HAVE_RINT /* defined in this file */ -#define NO_FCNTL_NONBLOCK /* No FCNTL */ -#define HAVE_ALLOCA -#define HAVE_STRPBRK -#define HAVE_STRSTR - -#ifdef WIN32 -#define HAVE_SNPRINTF /* Gave link error */ -#define snprintf _snprintf -#endif - -#ifdef _MSC_VER -#define HAVE_LDIV /* The optimizer breaks in zortech for ldiv */ -#define HAVE_ANSI_INCLUDE -#define HAVE_SYS_UTIME_H -#define HAVE_STRTOUL -#endif -#define my_reinterpret_cast(A) reinterpret_cast -#define my_const_cast(A) const_cast - -/* MYSQL OPTIONS */ - -#ifdef _CUSTOMCONFIG_ -#include -#else -#define DEFAULT_MYSQL_HOME "c:\\mysql" -#define PACKAGE "mysql" -#define DEFAULT_BASEDIR "C:\\" -#define SHAREDIR "share" -#define DEFAULT_CHARSET_HOME "C:/mysql/" -#endif - -/* File name handling */ - -#define FN_LIBCHAR '\\' -#define FN_ROOTDIR "\\" -#define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */ -#define FN_NO_CASE_SENCE /* Files are not case-sensitive */ -#define MY_NFILE 1024 - -#define DO_NOT_REMOVE_THREAD_WRAPPERS -#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V)) -/* The following is only used for statistics, so it should be good enough */ -#ifdef __NT__ /* This should also work on Win98 but .. */ -#define thread_safe_add(V,C,L) InterlockedExchangeAdd((long*) &(V),(C)) -#define thread_safe_sub(V,C,L) InterlockedExchangeAdd((long*) &(V),-(long) (C)) -#define statistic_add(V,C,L) thread_safe_add((V),(C),(L)) -#else -#define thread_safe_add(V,C,L) \ - pthread_mutex_lock((L)); (V)+=(C); pthread_mutex_unlock((L)); -#define thread_safe_sub(V,C,L) \ - pthread_mutex_lock((L)); (V)-=(C); pthread_mutex_unlock((L)); -#define statistic_add(V,C,L) (V)+=(C) -#endif -#define statistic_increment(V,L) thread_safe_increment((V),(L)) -#define strcasecmp(A,B) _stricmp((A),(B)) - +/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA */ + +/* Defines for Win32 to make it compatible for MySQL */ + +#ifndef _config_win_h_ +#define _config_win_h_ + +#include +#include +#include +#include /* Because of rint() */ +#include +#include +#include +#include +#include + +#ifndef THREAD + #define THREAD +#endif + +#ifdef _WIN64 +#define MACHINE_TYPE "ia64" /* Define to machine type name */ +#else +#define MACHINE_TYPE "i32" /* Define to machine type name */ +#endif /* _WIN64 */ + +/* File and lock constants */ +#define O_SHARE 0x1000 /* Open file in sharing mode */ +#ifdef __BORLANDC__ +#define F_RDLCK LK_NBLCK /* read lock */ +#define F_WRLCK LK_NBRLCK /* write lock */ +#define F_UNLCK LK_UNLCK /* remove lock(s) */ +#else +#define F_RDLCK _LK_NBLCK /* read lock */ +#define F_WRLCK _LK_NBRLCK /* write lock */ +#define F_UNLCK _LK_UNLCK /* remove lock(s) */ +#endif + +#define F_EXCLUSIVE 1 /* We have only exclusive locking */ +#define F_TO_EOF (INT_MAX32/2) /* size for lock of all file */ +#define F_OK 0 /* parameter to access() */ + +#define S_IROTH S_IREAD /* for my_lib */ + +#ifdef __BORLANDC__ +#define FILE_BINARY O_BINARY /* my_fopen in binary mode */ +#define O_TEMPORARY 0 +#define O_SHORT_LIVED 0 +#define SH_DENYNO _SH_DENYNO +#else +#define O_BINARY _O_BINARY /* compability with MSDOS */ +#define FILE_BINARY _O_BINARY /* my_fopen in binary mode */ +#define O_TEMPORARY _O_TEMPORARY +#define O_SHORT_LIVED _O_SHORT_LIVED +#define SH_DENYNO _SH_DENYNO +#endif +#define NO_OPEN_3 /* For my_create() */ + +#define SIGQUIT SIGTERM /* No SIGQUIT */ + +#undef _REENTRANT /* Crashes something for win32 */ +#undef SAFE_MUTEX /* Can't be used on windows */ + +#define LL(A) ((__int64) A) + +/* Type information */ + +typedef unsigned short ushort; +typedef unsigned int uint; +typedef unsigned __int64 ulonglong; /* Microsofts 64 bit types */ +typedef __int64 longlong; +typedef int sigset_t; +#define longlong_defined +/* off_t should not be __int64 because of conflicts in header files; + Use my_off_t or os_off_t instead */ +typedef long off_t; +typedef __int64 os_off_t; +#ifdef _WIN64 +typedef UINT_PTR rf_SetTimer; +#else +typedef uint rf_SetTimer; +#endif + +#if (defined(_MSC_VER) && !(_MSC_VER < 1800)) +#define HAVE_STRTOULL 1 +#define HAVE_STRTOLL 1 +#endif + +#define Socket_defined +#define my_socket SOCKET +#ifndef bool +#define bool BOOL +#endif +#define SIGPIPE SIGINT +#define RETQSORTTYPE void +#define QSORT_TYPE_IS_VOID +#define RETSIGTYPE void +#define SOCKET_SIZE_TYPE int +#define my_socket_defined +#define bool_defined +#define byte_defined +#define HUGE_PTR +#define STDCALL __stdcall /* Used by libmariadb.dll */ + +#define VOID_SIGHANDLER +#define SIZEOF_CHAR 1 +#define SIZEOF_LONG 4 +#define SIZEOF_LONG_LONG 8 +#define SIZEOF_OFF_T 8 +#define HAVE_BROKEN_NETINET_INCLUDES +#ifdef __NT__ +#define HAVE_NAMED_PIPE /* We can only create pipes on NT */ +#endif + +/* Use all character sets in MySQL */ +#define USE_MB 1 +#define USE_MB_IDENT 1 +#define USE_STRCOLL 1 + +/* Convert some simple functions to Posix */ + +#define sigset(A,B) signal((A),(B)) +#define finite(A) _finite(A) +#define sleep(A) Sleep((A)*1000) + +#ifndef __BORLANDC__ +#define access(A,B) _access(A,B) +#endif + +#if defined(__cplusplus) + +inline double rint(double nr) +{ + double f = floor(nr); + double c = ceil(nr); + return (((c-nr) >= (nr-f)) ? f :c); +} + +#ifdef _WIN64 +#define ulonglong2double(A) ((double) (A)) +#define my_off_t2double(A) ((double) (A)) + +#else +inline double ulonglong2double(ulonglong value) +{ + longlong nr=(longlong) value; + if (nr >= 0) + return (double) nr; + return (18446744073709551616.0 + (double) nr); +} +#define my_off_t2double(A) ulonglong2double(A) +#endif /* _WIN64 */ +#else +#define inline __inline +#endif /* __cplusplus */ + +#define __attribute(A) + +#if SIZEOF_OFF_T > 4 +#define lseek(A,B,C) _lseeki64((A),(longlong) (B),(C)) +#define tell(A) _telli64(A) +#endif + +#define STACK_DIRECTION -1 + +/* redefine deprecated functions +#define sprintf sprintf_s +#define strcpy strcpy_s +#define strcat strcat_s +#define fopen fopen_r +#define freopen freopen_r +#define getenv _dupenv_s +*/ +#ifdef _WIN32 +#include +#endif + +#define HAVE_PERROR +#define HAVE_VFPRINT +#define HAVE_CHSIZE /* System has chsize() function */ +#define HAVE_RENAME /* Have rename() as function */ +#define HAVE_BINARY_STREAMS /* Have "b" flag in streams */ +#define HAVE_LONG_JMP /* Have long jump function */ +#define HAVE_LOCKING /* have locking() call */ +#define HAVE_ERRNO_AS_DEFINE /* errno is a define */ +#define HAVE_STDLIB /* everything is include in this file */ +#define HAVE_MEMCPY +#define HAVE_MEMMOVE +#define HAVE_GETCWD +#define HAVE_TELL +#define HAVE_TZNAME +#define HAVE_PUTENV +#define HAVE_SELECT +#define HAVE_SETLOCALE +#define HAVE_SOCKET /* Giangi */ +#define HAVE_FLOAT_H +#define HAVE_LIMITS_H +#define HAVE_STDDEF_H +#define HAVE_RINT /* defined in this file */ +#define NO_FCNTL_NONBLOCK /* No FCNTL */ +#define HAVE_ALLOCA +#define HAVE_STRPBRK +#define HAVE_STRSTR + +#ifdef WIN32 +#define HAVE_SNPRINTF /* Gave link error */ +#define snprintf _snprintf +#endif + +#ifdef _MSC_VER +#define HAVE_LDIV /* The optimizer breaks in zortech for ldiv */ +#define HAVE_ANSI_INCLUDE +#define HAVE_SYS_UTIME_H +#define HAVE_STRTOUL +#endif +#define my_reinterpret_cast(A) reinterpret_cast +#define my_const_cast(A) const_cast + +/* MYSQL OPTIONS */ + +#ifdef _CUSTOMCONFIG_ +#include +#else +#define DEFAULT_MYSQL_HOME "c:\\mysql" +#define PACKAGE "mysql" +#define DEFAULT_BASEDIR "C:\\" +#define SHAREDIR "share" +#define DEFAULT_CHARSET_HOME "C:/mysql/" +#endif + +/* File name handling */ + +#define FN_LIBCHAR '\\' +#define FN_ROOTDIR "\\" +#define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */ +#define FN_NO_CASE_SENCE /* Files are not case-sensitive */ +#define MY_NFILE 1024 + +#define DO_NOT_REMOVE_THREAD_WRAPPERS +#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V)) +/* The following is only used for statistics, so it should be good enough */ +#ifdef __NT__ /* This should also work on Win98 but .. */ +#define thread_safe_add(V,C,L) InterlockedExchangeAdd((long*) &(V),(C)) +#define thread_safe_sub(V,C,L) InterlockedExchangeAdd((long*) &(V),-(long) (C)) +#define statistic_add(V,C,L) thread_safe_add((V),(C),(L)) +#else +#define thread_safe_add(V,C,L) \ + pthread_mutex_lock((L)); (V)+=(C); pthread_mutex_unlock((L)); +#define thread_safe_sub(V,C,L) \ + pthread_mutex_lock((L)); (V)-=(C); pthread_mutex_unlock((L)); +#define statistic_add(V,C,L) (V)+=(C) +#endif +#define statistic_increment(V,L) thread_safe_increment((V),(L)) +#define strcasecmp(A,B) _stricmp((A),(B)) + #define close(A) _close((A)) #define fdopen(A,B) _fdopen((A),(B)) #define sopen(A,B,C,D) _sopen((A),(B),(C),(D)) - - -#endif + + +#endif diff --git a/include/mysql/errmsg.h b/include/mysql/errmsg.h index 300da39..6bcf50a 100644 --- a/include/mysql/errmsg.h +++ b/include/mysql/errmsg.h @@ -66,6 +66,7 @@ extern const char *client_errors[]; /* Error messages */ #define CR_PARAMS_NOT_BOUND 2031 #define CR_INVALID_PARAMETER_NO 2034 #define CR_UNSUPPORTED_PARAM_TYPE 2036 +#define CR_SECURE_AUTH 2049 #define CR_NO_DATA 2051 #define CR_NO_STMT_METADATA 2052 #define CR_NOT_IMPLEMENTED 2054 diff --git a/include/mysql/m_string.h b/include/mysql/m_string.h index 7d10212..3d59741 100644 --- a/include/mysql/m_string.h +++ b/include/mysql/m_string.h @@ -224,6 +224,16 @@ extern ulonglong strtoull(const char *str, char **ptr, int base); #endif #endif +typedef enum { + MY_GCVT_ARG_FLOAT, + MY_GCVT_ARG_DOUBLE +} my_gcvt_arg_type; + +size_t ma_fcvt(double x, int precision, char *to, my_bool *error); +size_t ma_gcvt(double x, my_gcvt_arg_type type, int width, char *to, + my_bool *error); + + #if defined(__cplusplus) } #endif diff --git a/include/mysql/ma_common.h b/include/mysql/ma_common.h index 599d639..fa89056 100644 --- a/include/mysql/ma_common.h +++ b/include/mysql/ma_common.h @@ -49,6 +49,9 @@ struct st_mysql_options_extension { const char *proc_info, unsigned int proc_info_length); MARIADB_DB_DRIVER *db_driver; + char *ssl_fp; /* finger print of server certificate */ + char *ssl_fp_list; /* white list of finger prints */ + int (*verify_local_infile)(void *data, const char *filename); }; diff --git a/include/mysql/ma_dyncol.h b/include/mysql/ma_dyncol.h index c1eb71c..3b5c8ae 100644 --- a/include/mysql/ma_dyncol.h +++ b/include/mysql/ma_dyncol.h @@ -39,6 +39,18 @@ extern "C" { #endif #include +#ifndef longlong_defined +#if defined(HAVE_LONG_LONG) && SIZEOF_LONG != 8 +typedef unsigned long long int ulonglong; /* ulong or unsigned long long */ +typedef long long int longlong; +#else +typedef unsigned long ulonglong; /* ulong or unsigned long long */ +typedef long longlong; +#endif +#define longlong_defined +#endif + + #ifndef _my_sys_h typedef struct st_dynamic_string { diff --git a/include/mysql/ma_secure.h b/include/mysql/ma_secure.h index 148d65b..b380630 100644 --- a/include/mysql/ma_secure.h +++ b/include/mysql/ma_secure.h @@ -36,6 +36,7 @@ size_t my_ssl_write(Vio *vio, const uchar* buf, size_t size); SSL *my_ssl_init(MYSQL *mysql); int my_ssl_connect(SSL *ssl); int my_ssl_verify_server_cert(SSL *ssl); +int ma_ssl_verify_fingerprint(SSL *ssl); int my_ssl_start(MYSQL *mysql); void my_ssl_end(void); diff --git a/include/mysql/my_config.h b/include/mysql/my_config.h index 7c4b65a..4da9c53 100644 --- a/include/mysql/my_config.h +++ b/include/mysql/my_config.h @@ -44,6 +44,7 @@ /* #undef HAVE_SYSENT_H */ /* #undef HAVE_TERMIO_H */ /* #undef HAVE_TERMIOS_H */ +/* #undef HAVE_UCONTEXT_H */ /* #undef HAVE_UNISTD_H */ /* #undef HAVE_UTIME_H */ @@ -272,7 +273,7 @@ * various other defines */ #define HAVE_THREADS 1 -#define SHAREDIR "share" -#define DEFAULT_CHARSET_HOME "C:/Program Files (x86)/mariadb-client" -#define PLUGINDIR "C:/Program Files (x86)/mariadb-client/lib/plugin" +/* #undef SHAREDIR */ +#define DEFAULT_CHARSET_HOME "C:/Program Files (x86)/mariadb-connector-c" +#define PLUGINDIR "/lib/plugin" diff --git a/include/mysql/my_config.h.in b/include/mysql/my_config.h.in new file mode 100644 index 0000000..9388b9a --- /dev/null +++ b/include/mysql/my_config.h.in @@ -0,0 +1,279 @@ + +/* + * Include file constants (processed in LibmysqlIncludeFiles.txt 1 + */ +#cmakedefine HAVE_ALLOCA_H 1 +#cmakedefine HAVE_ARPA_INET_H 1 +#cmakedefine HAVE_CRYPT_H 1 +#cmakedefine HAVE_DIRENT_H 1 +#cmakedefine HAVE_DLFCN_H 1 +#cmakedefine HAVE_EXECINFO_H 1 +#cmakedefine HAVE_FCNTL_H 1 +#cmakedefine HAVE_FENV_H 1 +#cmakedefine HAVE_FLOAT_H 1 +#cmakedefine HAVE_FPU_CONTROL_H 1 +#cmakedefine HAVE_GRP_H 1 +#cmakedefine HAVE_IEEEFP_H 1 +#cmakedefine HAVE_LIMITS_H 1 +#cmakedefine HAVE_MALLOC_H 1 +#cmakedefine HAVE_MEMORY_H 1 +#cmakedefine HAVE_NETINET_IN_H 1 +#cmakedefine HAVE_PATHS_H 1 +#cmakedefine HAVE_PWD_H 1 +#cmakedefine HAVE_SCHED_H 1 +#cmakedefine HAVE_SELECT_H 1 +#cmakedefine HAVE_STDDEF_H 1 +#cmakedefine HAVE_STDINT_H 1 +#cmakedefine HAVE_STDLIB_H 1 +#cmakedefine HAVE_STRING_H 1 +#cmakedefine HAVE_STRINGS_H 1 +#cmakedefine HAVE_SYNCH_H 1 +#cmakedefine HAVE_SYS_FPU_H 1 +#cmakedefine HAVE_SYS_IOCTL_H 1 +#cmakedefine HAVE_SYS_IPC_H 1 +#cmakedefine HAVE_SYS_MMAN_H 1 +#cmakedefine HAVE_SYS_PRCTL_H 1 +#cmakedefine HAVE_SYS_SELECT_H 1 +#cmakedefine HAVE_SYS_SHM_H 1 +#cmakedefine HAVE_SYS_SOCKET_H 1 +#cmakedefine HAVE_SYS_STAT_H 1 +#cmakedefine HAVE_SYS_STREAM_H 1 +#cmakedefine HAVE_SYS_TIMEB_H 1 +#cmakedefine HAVE_SYS_TYPES_H 1 +#cmakedefine HAVE_SYS_UN_H 1 +#cmakedefine HAVE_SYSENT_H 1 +#cmakedefine HAVE_TERMIO_H 1 +#cmakedefine HAVE_TERMIOS_H 1 +#cmakedefine HAVE_UCONTEXT_H 1 +#cmakedefine HAVE_UNISTD_H 1 +#cmakedefine HAVE_UTIME_H 1 + +/* + * function definitions - processed in LibmysqlFunctions.txt + */ +#cmakedefine HAVE_ACCESS 1 +#cmakedefine HAVE_AIOWAIT 1 +#cmakedefine HAVE_ALARM 1 +#cmakedefine HAVE_ALLOCA 1 +#cmakedefine HAVE_BCMP 1 +#cmakedefine HAVE_BFILL 1 +#cmakedefine HAVE_BMOVE 1 +#cmakedefine HAVE_BZERO 1 +#cmakedefine HAVE_CLOCK_GETTIME 1 +#cmakedefine HAVE_COMPRESS 1 +#cmakedefine HAVE_CRYPT 1 +#cmakedefine HAVE_DLERROR 1 +#cmakedefine HAVE_DLOPEN 1 +#cmakedefine HAVE_FCHMOD 1 +#cmakedefine HAVE_FCNTL 1 +#cmakedefine HAVE_FCONVERT 1 +#cmakedefine HAVE_FDATASYNC 1 +#cmakedefine HAVE_FESETROUND 1 +#cmakedefine HAVE_FINITE 1 +#cmakedefine HAVE_FSEEKO 1 +#cmakedefine HAVE_FSYNC 1 +#cmakedefine HAVE_GETADDRINFO 1 +#cmakedefine HAVE_GETCWD 1 +#cmakedefine HAVE_GETHOSTBYADDR_R 1 +#cmakedefine HAVE_GETHOSTBYNAME_R 1 +#cmakedefine HAVE_GETHRTIME 1 +#cmakedefine HAVE_GETNAMEINFO 1 +#cmakedefine HAVE_GETPAGESIZE 1 +#cmakedefine HAVE_GETPASS 1 +#cmakedefine HAVE_GETPASSPHRASE 1 +#cmakedefine HAVE_GETPWNAM 1 +#cmakedefine HAVE_GETPWUID 1 +#cmakedefine HAVE_GETRLIMIT 1 +#cmakedefine HAVE_GETRUSAGE 1 +#cmakedefine HAVE_GETWD 1 +#cmakedefine HAVE_GMTIME_R 1 +#cmakedefine HAVE_INITGROUPS 1 +#cmakedefine HAVE_LDIV 1 +#cmakedefine HAVE_LOCALTIME_R 1 +#cmakedefine HAVE_LOG2 1 +#cmakedefine HAVE_LONGJMP 1 +#cmakedefine HAVE_LSTAT 1 +#cmakedefine HAVE_MADVISE 1 +#cmakedefine HAVE_MALLINFO 1 +#cmakedefine HAVE_MEMALIGN 1 +#cmakedefine HAVE_MEMCPY 1 +#cmakedefine HAVE_MEMMOVE 1 +#cmakedefine HAVE_MKSTEMP 1 +#cmakedefine HAVE_MLOCK 1 +#cmakedefine HAVE_MLOCKALL 1 +#cmakedefine HAVE_MMAP 1 +#cmakedefine HAVE_MMAP64 1 +#cmakedefine HAVE_PERROR 1 +#cmakedefine HAVE_POLL 1 +#cmakedefine HAVE_PREAD 1 +#cmakedefine HAVE_PTHREAD_ATTR_CREATE 1 +#cmakedefine HAVE_PTHREAD_ATTR_GETSTACKSIZE 1 +#cmakedefine HAVE_PTHREAD_ATTR_SETPRIO 1 +#cmakedefine HAVE_PTHREAD_ATTR_SETSCHEDPARAM 1 +#cmakedefine HAVE_PTHREAD_ATTR_SETSCOPE 1 +#cmakedefine HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 +#cmakedefine HAVE_PTHREAD_CONDATTR_CREATE 1 +#cmakedefine HAVE_PTHREAD_INIT 1 +#cmakedefine HAVE_PTHREAD_KEY_DELETE 1 +#cmakedefine HAVE_PTHREAD_KILL 1 +#cmakedefine HAVE_PTHREAD_RWLOCK_RDLOCK 1 +#cmakedefine HAVE_PTHREAD_SETPRIO_NP 1 +#cmakedefine HAVE_PTHREAD_SETSCHEDPARAM 1 +#cmakedefine HAVE_PTHREAD_SIGMASK 1 +#cmakedefine HAVE_PTHREAD_THREADMASK 1 +#cmakedefine HAVE_PTHREAD_YIELD_NP 1 +#cmakedefine HAVE_READDIR_R 1 +#cmakedefine HAVE_READLINK 1 +#cmakedefine HAVE_REALPATH 1 +#cmakedefine HAVE_RENAME 1 +#cmakedefine HAVE_SCHED_YIELD 1 +#cmakedefine HAVE_SELECT 1 +#cmakedefine HAVE_SETFD 1 +#cmakedefine HAVE_SETFILEPOINTER 1 +#cmakedefine HAVE_SIGNAL 1 +#cmakedefine HAVE_SIGACTION 1 +#cmakedefine HAVE_SIGTHREADMASK 1 +#cmakedefine HAVE_SIGWAIT 1 +#cmakedefine HAVE_SLEEP 1 +#cmakedefine HAVE_SNPRINTF 1 +#cmakedefine HAVE_SQLITE 1 +#cmakedefine HAVE_STPCPY 1 +#cmakedefine HAVE_STRERROR 1 +#cmakedefine HAVE_STRLCPY 1 +#cmakedefine HAVE_STRNLEN 1 +#cmakedefine HAVE_STRPBRK 1 +#cmakedefine HAVE_STRSEP 1 +#cmakedefine HAVE_STRSTR 1 +#cmakedefine HAVE_STRTOK_R 1 +#cmakedefine HAVE_STRTOL 1 +#cmakedefine HAVE_STRTOLL 1 +#cmakedefine HAVE_STRTOUL 1 +#cmakedefine HAVE_STRTOULL 1 +#cmakedefine HAVE_TELL 1 +#cmakedefine HAVE_THR_SETCONCURRENCY 1 +#cmakedefine HAVE_THR_YIELD 1 +#cmakedefine HAVE_VASPRINTF 1 +#cmakedefine HAVE_VSNPRINTF 1 + +/* + * types and sizes + */ +/* Types we may use */ +#cmakedefine SIZEOF_CHAR @SIZEOF_CHAR@ +#if SIZEOF_CHAR +# define HAVE_CHAR 1 +#endif + +#cmakedefine SIZEOF_CHARP @SIZEOF_CHARP@ +#if SIZEOF_CHARP +# define HAVE_CHARP 1 +#endif + +#cmakedefine SIZEOF_SHORT @SIZEOF_SHORT@ +#if SIZEOF_SHORT +# define HAVE_SHORT 1 +#endif + +#cmakedefine SIZEOF_INT @SIZEOF_INT@ +#if SIZEOF_INT +# define HAVE_INT 1 +#endif + +#cmakedefine SIZEOF_LONG @SIZEOF_LONG@ +#if SIZEOF_LONG +# define HAVE_LONG 1 +#endif + +#cmakedefine SIZEOF_LONG_LONG @SIZEOF_LONG_LONG@ +#if SIZEOF_LONG_LONG +# define HAVE_LONG_LONG 1 +#endif + +#cmakedefine SIZEOF_OFF_T @SIZEOF_OFF_T@ +#if SIZEOF_OFF_T +# define HAVE_OFF_T 1 +#endif + +#cmakedefine SIZEOF_SIGSET_T @SIZEOF_SIGSET_T@ +#if SIZEOF_SIGSET_T +# define HAVE_SIGSET_T 1 +#endif + +#cmakedefine SIZEOF_SIZE_T @SIZEOF_SIZE_T@ +#if SIZEOF_SIZE_T +# define HAVE_SIZE_T 1 +#endif + +#cmakedefine SIZEOF_UCHAR @SIZEOF_UCHAR@ +#if SIZEOF_UCHAR +# define HAVE_UCHAR 1 +#endif + +#cmakedefine SIZEOF_UINT @SIZEOF_UINT@ +#if SIZEOF_UINT +# define HAVE_UINT 1 +#endif + +#cmakedefine SIZEOF_ULONG @SIZEOF_ULONG@ +#if SIZEOF_ULONG +# define HAVE_ULONG 1 +#endif + +#cmakedefine SIZEOF_INT8 @SIZEOF_INT8@ +#if SIZEOF_INT8 +# define HAVE_INT8 1 +#endif +#cmakedefine SIZEOF_UINT8 @SIZEOF_UINT8@ +#if SIZEOF_UINT8 +# define HAVE_UINT8 1 +#endif + +#cmakedefine SIZEOF_INT16 @SIZEOF_INT16@ +#if SIZEOF_INT16 +# define HAVE_INT16 1 +#endif +#cmakedefine SIZEOF_UINT16 @SIZEOF_UINT16@ +#if SIZEOF_UINT16 +# define HAVE_UINT16 1 +#endif + +#cmakedefine SIZEOF_INT32 @SIZEOF_INT32@ +#if SIZEOF_INT32 +# define HAVE_INT32 1 +#endif +#cmakedefine SIZEOF_UINT32 @SIZEOF_UINT32@ +#if SIZEOF_UINT32 +# define HAVE_UINT32 1 +#endif +#cmakedefine SIZEOF_U_INT32_T @SIZEOF_U_INT32_T@ +#if SIZEOF_U_INT32_T +# define HAVE_U_INT32_T 1 +#endif + +#cmakedefine SIZEOF_INT64 @SIZEOF_INT64@ +#if SIZEOF_INT64 +# define HAVE_INT64 1 +#endif +#cmakedefine SIZEOF_UINT64 @SIZEOF_UINT64@ +#if SIZEOF_UINT64 +# define HAVE_UINT64 1 +#endif + +#cmakedefine SIZEOF_SOCKLEN_T @SIZEOF_SOCKLEN_T@ +#if SIZEOF_SOCKLEN_T +# define HAVE_SOCKLEN_T 1 +#endif + +#cmakedefine SOCKET_SIZE_TYPE @SOCKET_SIZE_TYPE@ + +#cmakedefine RETSIGTYPE @RETSIGTYPE@ +#cmakedefine RETQSORTTYPE @RETQSORTTYPE@ + +/* + * various other defines + */ +#cmakedefine HAVE_THREADS 1 +#cmakedefine SHAREDIR "@SHAREDIR@" +#cmakedefine DEFAULT_CHARSET_HOME "@DEFAULT_CHARSET_HOME@" +#cmakedefine PLUGINDIR "@PREFIX_INSTALL_DIR@/@PLUGIN_INSTALL_DIR@" + diff --git a/include/mysql/my_context.h b/include/mysql/my_context.h index c7b4166..e4f80a1 100644 --- a/include/mysql/my_context.h +++ b/include/mysql/my_context.h @@ -31,7 +31,7 @@ #define MY_CONTEXT_USE_X86_64_GCC_ASM #elif defined(__GNUC__) && __GNUC__ >= 3 && defined(__i386__) #define MY_CONTEXT_USE_I386_GCC_ASM -#elif defined(HAVE_UCONTEXT) +#elif defined(HAVE_UCONTEXT_H) #define MY_CONTEXT_USE_UCONTEXT #else #define MY_CONTEXT_DISABLE diff --git a/include/mysql/my_global.h b/include/mysql/my_global.h index 13129c4..176404c 100644 --- a/include/mysql/my_global.h +++ b/include/mysql/my_global.h @@ -21,7 +21,6 @@ #ifndef _global_h #define _global_h - #ifdef _WIN32 #include #else @@ -318,7 +317,6 @@ typedef unsigned short ushort; */ #define _VARARGS(X) X #define _STATIC_VARARGS(X) X -#define _PC(X) X #if defined(DBUG_ON) && defined(DBUG_OFF) #undef DBUG_OFF @@ -364,15 +362,11 @@ typedef int (*qsort_cmp)(const void *,const void *); #else #define qsort_t RETQSORTTYPE /* Broken GCC cant handle typedef !!!! */ #endif -typedef SOCKET_SIZE_TYPE size_socket; - -#ifndef SOCKOPT_OPTLEN_TYPE -#define SOCKOPT_OPTLEN_TYPE size_socket -#endif #ifdef HAVE_SYS_SOCKET_H #include #endif +typedef SOCKET_SIZE_TYPE size_socket; #ifndef SOCKOPT_OPTLEN_TYPE #define SOCKOPT_OPTLEN_TYPE size_socket @@ -459,8 +453,11 @@ typedef SOCKET_SIZE_TYPE size_socket; #ifdef _WIN32 #define NO_DIR_LIBRARY /* Not standar dir-library */ #define USE_MY_STAT_STRUCT /* For my_lib */ +#ifdef _MSC_VER + typedef SSIZE_T ssize_t; #endif +#endif /* Some things that this system does have */ @@ -528,7 +525,7 @@ extern double my_atof(const char*); #define HAVE_LONG_LONG 1 #endif -#if defined(HAVE_LONG_LONG) && !defined(LONGLONG_MIN) +#if defined(HAVE_LONG_LONG) && !defined(LONGLONG_IN) #define LONGLONG_MIN ((long long) 0x8000000000000000LL) #define LONGLONG_MAX ((long long) 0x7FFFFFFFFFFFFFFFLL) #endif @@ -649,6 +646,13 @@ typedef long longlong; #define longlong_defined #endif +#ifndef HAVE_INT64 +typedef longlong int64; +#endif +#ifndef HAVE_UINT64 +typedef ulonglong uint64; +#endif + #ifndef MIN #define MIN(a,b) (((a) < (b)) ? (a) : (b)) #endif @@ -1082,7 +1086,7 @@ do { doubleget_union _tmp; \ #elif defined(HAVE_DLFCN_H) #include #endif -#if HAVE_DLERROR +#ifndef HAVE_DLERROR #define dlerror() "" #endif #endif diff --git a/include/mysql/my_pthread.h b/include/mysql/my_pthread.h index 2117868..1d4f894 100644 --- a/include/mysql/my_pthread.h +++ b/include/mysql/my_pthread.h @@ -62,11 +62,13 @@ typedef struct { } pthread_cond_t; #ifndef _TIMESPEC_DEFINED +#if (!defined(_MSC_VER) || _MSC_VER < 1900) struct timespec { /* For pthread_cond_timedwait() */ time_t tv_sec; long tv_nsec; }; #endif +#endif typedef int pthread_mutexattr_t; #define pthread_self() GetCurrentThreadId() diff --git a/include/mysql/my_sys.h b/include/mysql/my_sys.h index dc82598..dabaa12 100644 --- a/include/mysql/my_sys.h +++ b/include/mysql/my_sys.h @@ -122,11 +122,11 @@ extern int NEAR my_errno; /* Last error in mysys */ extern gptr my_malloc(size_t Size,myf MyFlags); #define my_malloc_ci(SZ,FLAG) my_malloc( SZ, FLAG ) extern gptr my_realloc(gptr oldpoint, size_t Size,myf MyFlags); -extern void my_no_flags_free(gptr ptr); +extern void my_no_flags_free(void *ptr); extern gptr my_memdup(const unsigned char *from, size_t length,myf MyFlags); extern my_string my_strdup(const char *from,myf MyFlags); extern my_string my_strndup(const char *from, size_t length, myf MyFlags); -#define my_free(PTR,FG) my_no_flags_free(PTR) +#define my_free(PTR) my_no_flags_free(PTR) #define CALLER_INFO_PROTO /* nothing */ #define CALLER_INFO /* nothing */ #define ORIG_CALLER_INFO /* nothing */ @@ -144,7 +144,7 @@ extern my_string my_strndup(const char *from, size_t length, myf MyFlags); #define my_afree(PTR) {} #else #define my_alloca(SZ) my_malloc(SZ,MYF(0)) -#define my_afree(PTR) my_free(PTR,MYF(MY_WME)) +#define my_afree(PTR) my_free(PTR) #endif /* HAVE_ALLOCA */ #ifdef MSDOS diff --git a/include/mysql/mysql.h b/include/mysql/mysql.h index 2194292..0fec111 100644 --- a/include/mysql/mysql.h +++ b/include/mysql/mysql.h @@ -80,13 +80,14 @@ typedef int my_socket; extern unsigned int mysql_port; extern char *mysql_unix_port; +extern unsigned int mariadb_deinitialize_ssl; #define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG) #define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG) #define IS_BLOB(n) ((n) & BLOB_FLAG) #define IS_NUM(t) ((t) <= FIELD_TYPE_INT24 || (t) == FIELD_TYPE_YEAR) #define IS_NUM_FIELD(f) ((f)->flags & NUM_FLAG) -#define INTERNAL_NUM_FIELD(f) (((f)->type <= MYSQL_TYPE_INT24 && ((f)->type != MYSQL_TYPE_TIMESTAMP || (f)->length == 14 || (f)->length == 8)) || (f)->type == MYSQL_TYPE_YEAR) +#define INTERNAL_NUM_FIELD(f) (((f)->type <= MYSQL_TYPE_INT24 && ((f)->type != MYSQL_TYPE_TIMESTAMP || (f)->length == 14 || (f)->length == 8)) || (f)->type == MYSQL_TYPE_YEAR || (f)->type == MYSQL_TYPE_NEWDECIMAL || (f)->type == MYSQL_TYPE_DECIMAL) typedef struct st_mysql_field { char *name; /* Name of column */ @@ -125,15 +126,6 @@ extern char *mysql_unix_port; typedef unsigned long long my_ulonglong; #endif -#ifndef longlong_defined -#if defined(HAVE_LONG_LONG) && SIZEOF_LONG != 8 -typedef long long int longlong; -#else -typedef long longlong; -#endif -#define longlong_defined -#endif - /* mysql compatibility macro */ #define mysql_options4(A,B,C,D) mysql_optionsv((A),(B),(C),(D)) @@ -211,16 +203,22 @@ typedef long longlong; MYSQL_OPT_CONNECT_ATTR_RESET, MYSQL_OPT_CONNECT_ATTR_ADD, MYSQL_OPT_CONNECT_ATTR_DELETE, + MYSQL_SERVER_PUBLIC_KEY, + MYSQL_ENABLE_CLEARTEXT_PLUGIN, /* MariaDB specific */ MYSQL_PROGRESS_CALLBACK=5999, MYSQL_OPT_NONBLOCK, - MYSQL_DATABASE_DRIVER=7000 + /* MariaDB Connector/C specific */ + MYSQL_DATABASE_DRIVER=7000, + MARIADB_OPT_SSL_FP, /* single finger print for server certificate verification */ + MARIADB_OPT_SSL_FP_LIST, /* finger print white list for server certificate verification */ + MARIADB_OPT_VERIFY_LOCAL_INFILE_CALLBACK }; enum mysql_status { MYSQL_STATUS_READY, MYSQL_STATUS_GET_RESULT, - MYSQL_STATUS_USE_RESULT, + MYSQL_STATUS_USE_RESULT, MYSQL_STATUS_QUERY_SENT, MYSQL_STATUS_SENDING_LOAD_DATA, MYSQL_STATUS_FETCHING_DATA, @@ -254,7 +252,7 @@ struct st_mysql_options { my_bool compress,named_pipe; my_bool unused_1, unused_2, unused_3, unused_4; enum mysql_option methods_to_use; - char *client_ip; + char *bind_address; my_bool secure_auth; my_bool report_data_truncation; /* function pointers for local infile support */ @@ -262,7 +260,7 @@ struct st_mysql_options { int (*local_infile_read)(void *, char *, unsigned int); void (*local_infile_end)(void *); int (*local_infile_error)(void *, char *, unsigned int); - void *local_infile_userdata; + void *local_infile_userdata[2]; struct st_mysql_options_extension *extension; }; @@ -334,6 +332,7 @@ typedef struct st_mysql_time #define AUTO_SEC_PART_DIGITS 31 #define SEC_PART_DIGITS 6 +#define MARIADB_INVALID_SOCKET -1 /* Ansynchronous API constants */ #define MYSQL_WAIT_READ 1 @@ -508,6 +507,8 @@ int STDCALL mysql_autocommit_start(my_bool *ret, MYSQL * mysql, int STDCALL mysql_autocommit_cont(my_bool *ret, MYSQL * mysql, int status); int STDCALL mysql_next_result_start(int *ret, MYSQL *mysql); int STDCALL mysql_next_result_cont(int *ret, MYSQL *mysql, int status); +int STDCALL mysql_select_db_start(int *ret, MYSQL *mysql, const char *db); +int STDCALL mysql_select_db_cont(int *ret, MYSQL *mysql, int ready_status); int STDCALL mysql_stmt_next_result_start(int *ret, MYSQL_STMT *stmt); int STDCALL mysql_stmt_next_result_cont(int *ret, MYSQL_STMT *stmt, int status); diff --git a/include/mysql/mysql/client_plugin.h b/include/mysql/mysql/client_plugin.h new file mode 100644 index 0000000..1e706c2 --- /dev/null +++ b/include/mysql/mysql/client_plugin.h @@ -0,0 +1,203 @@ +/* Copyright (C) 2010 - 2012 Sergei Golubchik and Monty Program Ab + 2014 MariaDB Corporation AB + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not see + or write to the Free Software Foundation, Inc., + 51 Franklin St., Fifth Floor, Boston, MA 02110, USA */ + +/** + @file + + MySQL Client Plugin API + + This file defines the API for plugins that work on the client side +*/ +#ifndef MYSQL_CLIENT_PLUGIN_INCLUDED +#define MYSQL_CLIENT_PLUGIN_INCLUDED + +#ifndef MYSQL_ABI_CHECK +#include +#include +#endif + +#ifndef PLUGINDIR +#define PLUGINDIR "lib/plugin" +#endif + +/* known plugin types */ +#define MYSQL_CLIENT_DB_PLUGIN 0 +#define MYSQL_CLIENT_reserved 1 +#define MYSQL_CLIENT_AUTHENTICATION_PLUGIN 2 + +#define MYSQL_CLIENT_AUTHENTICATION_PLUGIN_INTERFACE_VERSION 0x0100 +#define MYSQL_CLIENT_DB_PLUGIN_INTERFACE_VERSION 0x0100 + +#define MYSQL_CLIENT_MAX_PLUGINS 3 + +#define mysql_declare_client_plugin(X) \ + struct st_mysql_client_plugin_ ## X \ + _mysql_client_plugin_declaration_ = { \ + MYSQL_CLIENT_ ## X ## _PLUGIN, \ + MYSQL_CLIENT_ ## X ## _PLUGIN_INTERFACE_VERSION, +#define mysql_end_client_plugin } + +/* generic plugin header structure */ +#define MYSQL_CLIENT_PLUGIN_HEADER \ + int type; \ + unsigned int interface_version; \ + const char *name; \ + const char *author; \ + const char *desc; \ + unsigned int version[3]; \ + int (*init)(char *, size_t, int, va_list); \ + int (*deinit)(void); + +struct st_mysql_client_plugin +{ + MYSQL_CLIENT_PLUGIN_HEADER +}; + +struct st_mysql; + +/********* database api plugin specific declarations **********/ +typedef struct st_mariadb_client_plugin_DB +{ + MYSQL_CLIENT_PLUGIN_HEADER + /* functions */ + struct st_mysql_methods *methods; + /* + MYSQL * (*db_connect)(MYSQL *mysql,const char *host, const char *user, + const char *passwd, const char *db, uint port, + const char *unix_socket,unsigned long client_flag); + void (*db_close)(MYSQL *mysql); + int (*db_query)(MYSQL *mysql, const char *query, size_t query_len); + int (*db_read_one_row)(MYSQL *mysql, uint fields, MYSQL_ROW row, + ulong *lengths); + MYSQL_DATA *(*db_read_all_rows)(MYSQL *mysql, + MYSQL_FIELD *mysql_fields, uint fields); + void (*db_query_end)(MYSQL *mysql); + int (*db_stmt_prepare)(MYSQL_STMT *stmt, const char *stmt_str, ulong length); + my_bool (*db_stmt_close)(MYSQL_STMT *stmt); + my_bool (*is_supported_buffer_type)(enum enum_field_types type); + int (*db_stmt_fetch)(MYSQL_STMT *stmt); + int (*db_stmt_execute)(MYSQL_STMT *stmt); */ +} MARIADB_DB_PLUGIN; + +#define MARIADB_DB_DRIVER(a) ((a)->ext_db) + +/******** authentication plugin specific declarations *********/ +#include + +struct st_mysql_client_plugin_AUTHENTICATION +{ + MYSQL_CLIENT_PLUGIN_HEADER + int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, struct st_mysql *mysql); +}; + +/** + type of the mysql_authentication_dialog_ask function + + @param mysql mysql + @param type type of the input + 1 - ordinary string input + 2 - password string + @param prompt prompt + @param buf a buffer to store the use input + @param buf_len the length of the buffer + + @retval a pointer to the user input string. + It may be equal to 'buf' or to 'mysql->password'. + In all other cases it is assumed to be an allocated + string, and the "dialog" plugin will free() it. +*/ +typedef char *(*mysql_authentication_dialog_ask_t)(struct st_mysql *mysql, + int type, const char *prompt, char *buf, int buf_len); +/******** using plugins ************/ + +/** + loads a plugin and initializes it + + @param mysql MYSQL structure. only MYSQL_PLUGIN_DIR option value is used, + and last_errno/last_error, for error reporting + @param name a name of the plugin to load + @param type type of plugin that should be loaded, -1 to disable type check + @param argc number of arguments to pass to the plugin initialization + function + @param ... arguments for the plugin initialization function + + @retval + a pointer to the loaded plugin, or NULL in case of a failure +*/ +struct st_mysql_client_plugin * STDCALL +mysql_load_plugin(struct st_mysql *mysql, const char *name, int type, + int argc, ...); + +/** + loads a plugin and initializes it, taking va_list as an argument + + This is the same as mysql_load_plugin, but take va_list instead of + a list of arguments. + + @param mysql MYSQL structure. only MYSQL_PLUGIN_DIR option value is used, + and last_errno/last_error, for error reporting + @param name a name of the plugin to load + @param type type of plugin that should be loaded, -1 to disable type check + @param argc number of arguments to pass to the plugin initialization + function + @param args arguments for the plugin initialization function + + @retval + a pointer to the loaded plugin, or NULL in case of a failure +*/ +struct st_mysql_client_plugin * STDCALL +mysql_load_plugin_v(struct st_mysql *mysql, const char *name, int type, + int argc, va_list args); + +/** + finds an already loaded plugin by name, or loads it, if necessary + + @param mysql MYSQL structure. only MYSQL_PLUGIN_DIR option value is used, + and last_errno/last_error, for error reporting + @param name a name of the plugin to load + @param type type of plugin that should be loaded + + @retval + a pointer to the plugin, or NULL in case of a failure +*/ +struct st_mysql_client_plugin * STDCALL +mysql_client_find_plugin(struct st_mysql *mysql, const char *name, int type); + +/** + adds a plugin structure to the list of loaded plugins + + This is useful if an application has the necessary functionality + (for example, a special load data handler) statically linked into + the application binary. It can use this function to register the plugin + directly, avoiding the need to factor it out into a shared object. + + @param mysql MYSQL structure. It is only used for error reporting + @param plugin an st_mysql_client_plugin structure to register + + @retval + a pointer to the plugin, or NULL in case of a failure +*/ +struct st_mysql_client_plugin * STDCALL +mysql_client_register_plugin(struct st_mysql *mysql, + struct st_mysql_client_plugin *plugin); + +extern struct st_mysql_client_plugin *mysql_client_builtins[]; + +#endif + + diff --git a/include/mysql/mysql/plugin_auth.h b/include/mysql/mysql/plugin_auth.h new file mode 100644 index 0000000..513bcea --- /dev/null +++ b/include/mysql/mysql/plugin_auth.h @@ -0,0 +1,107 @@ +#ifndef MYSQL_PLUGIN_AUTH_COMMON_INCLUDED +/* Copyright (C) 2010 Sergei Golubchik and Monty Program Ab + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA */ + +/** + @file + + This file defines constants and data structures that are the same for + both client- and server-side authentication plugins. +*/ +#define MYSQL_PLUGIN_AUTH_COMMON_INCLUDED + +/** the max allowed length for a user name */ +#define MYSQL_USERNAME_LENGTH 512 + +/** + return values of the plugin authenticate_user() method. +*/ + +/** + Authentication failed. Additionally, all other CR_xxx values + (libmariadb error code) can be used too. + + The client plugin may set the error code and the error message directly + in the MYSQL structure and return CR_ERROR. If a CR_xxx specific error + code was returned, an error message in the MYSQL structure will be + overwritten. If CR_ERROR is returned without setting the error in MYSQL, + CR_UNKNOWN_ERROR will be user. +*/ +#define CR_ERROR 0 +/** + Authentication (client part) was successful. It does not mean that the + authentication as a whole was successful, usually it only means + that the client was able to send the user name and the password to the + server. If CR_OK is returned, the libmariadb reads the next packet expecting + it to be one of OK, ERROR, or CHANGE_PLUGIN packets. +*/ +#define CR_OK -1 +/** + Authentication was successful. + It means that the client has done its part successfully and also that + a plugin has read the last packet (one of OK, ERROR, CHANGE_PLUGIN). + In this case, libmariadb will not read a packet from the server, + but it will use the data at mysql->net.read_pos. + + A plugin may return this value if the number of roundtrips in the + authentication protocol is not known in advance, and the client plugin + needs to read one packet more to determine if the authentication is finished + or not. +*/ +#define CR_OK_HANDSHAKE_COMPLETE -2 + +typedef struct st_plugin_vio_info +{ + enum { MYSQL_VIO_INVALID, MYSQL_VIO_TCP, MYSQL_VIO_SOCKET, + MYSQL_VIO_PIPE, MYSQL_VIO_MEMORY } protocol; + int socket; /**< it's set, if the protocol is SOCKET or TCP */ +#ifdef _WIN32 + HANDLE handle; /**< it's set, if the protocol is PIPE or MEMORY */ +#endif +} MYSQL_PLUGIN_VIO_INFO; + +/** + Provides plugin access to communication channel +*/ +typedef struct st_plugin_vio +{ + /** + Plugin provides a pointer reference and this function sets it to the + contents of any incoming packet. Returns the packet length, or -1 if + the plugin should terminate. + */ + int (*read_packet)(struct st_plugin_vio *vio, + unsigned char **buf); + + /** + Plugin provides a buffer with data and the length and this + function sends it as a packet. Returns 0 on success, 1 on failure. + */ + int (*write_packet)(struct st_plugin_vio *vio, + const unsigned char *packet, + int packet_len); + + /** + Fills in a st_plugin_vio_info structure, providing the information + about the connection. + */ + void (*info)(struct st_plugin_vio *vio, struct st_plugin_vio_info *info); + +} MYSQL_PLUGIN_VIO; + +#endif + diff --git a/include/mysql/mysql/plugin_auth_common.h b/include/mysql/mysql/plugin_auth_common.h new file mode 100644 index 0000000..e0da067 --- /dev/null +++ b/include/mysql/mysql/plugin_auth_common.h @@ -0,0 +1,109 @@ +#ifndef MYSQL_PLUGIN_AUTH_COMMON_INCLUDED +/* Copyright (C) 2010 Sergei Golubchik and Monty Program Ab + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA */ + +/** + @file + + This file defines constants and data structures that are the same for + both client- and server-side authentication plugins. +*/ +#define MYSQL_PLUGIN_AUTH_COMMON_INCLUDED + +/** the max allowed length for a user name */ +#define MYSQL_USERNAME_LENGTH 512 + +/** + return values of the plugin authenticate_user() method. +*/ + +/** + Authentication failed. Additionally, all other CR_xxx values + (libmariadb error code) can be used too. + + The client plugin may set the error code and the error message directly + in the MYSQL structure and return CR_ERROR. If a CR_xxx specific error + code was returned, an error message in the MYSQL structure will be + overwritten. If CR_ERROR is returned without setting the error in MYSQL, + CR_UNKNOWN_ERROR will be user. +*/ +#define CR_ERROR 0 +/** + Authentication (client part) was successful. It does not mean that the + authentication as a whole was successful, usually it only means + that the client was able to send the user name and the password to the + server. If CR_OK is returned, the libmariadb reads the next packet expecting + it to be one of OK, ERROR, or CHANGE_PLUGIN packets. +*/ +#define CR_OK -1 +/** + Authentication was successful. + It means that the client has done its part successfully and also that + a plugin has read the last packet (one of OK, ERROR, CHANGE_PLUGIN). + In this case, libmariadb will not read a packet from the server, + but it will use the data at mysql->net.read_pos. + + A plugin may return this value if the number of roundtrips in the + authentication protocol is not known in advance, and the client plugin + needs to read one packet more to determine if the authentication is finished + or not. +*/ +#define CR_OK_HANDSHAKE_COMPLETE -2 + +typedef struct st_plugin_vio_info +{ + enum { MYSQL_VIO_INVALID, MYSQL_VIO_TCP, MYSQL_VIO_SOCKET, + MYSQL_VIO_PIPE, MYSQL_VIO_MEMORY } protocol; +#ifndef _WIN32 + int socket; /**< it's set, if the protocol is SOCKET or TCP */ +#else + SOCKET socket; /**< it's set, if the protocol is SOCKET or TCP */ + HANDLE handle; /**< it's set, if the protocol is PIPE or MEMORY */ +#endif +} MYSQL_PLUGIN_VIO_INFO; + +/** + Provides plugin access to communication channel +*/ +typedef struct st_plugin_vio +{ + /** + Plugin provides a pointer reference and this function sets it to the + contents of any incoming packet. Returns the packet length, or -1 if + the plugin should terminate. + */ + int (*read_packet)(struct st_plugin_vio *vio, + unsigned char **buf); + + /** + Plugin provides a buffer with data and the length and this + function sends it as a packet. Returns 0 on success, 1 on failure. + */ + int (*write_packet)(struct st_plugin_vio *vio, + const unsigned char *packet, + int packet_len); + + /** + Fills in a st_plugin_vio_info structure, providing the information + about the connection. + */ + void (*info)(struct st_plugin_vio *vio, struct st_plugin_vio_info *info); + +} MYSQL_PLUGIN_VIO; + +#endif + diff --git a/include/mysql/mysql_async.h b/include/mysql/mysql_async.h index 2728b9c..298f3f5 100644 --- a/include/mysql/mysql_async.h +++ b/include/mysql/mysql_async.h @@ -1,17 +1,20 @@ /* Copyright (C) 2012 MariaDB Services and Kristian Nielsen + 2015 MariaDB Corporation - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA */ /* Common definitions for MariaDB non-blocking client library. */ diff --git a/include/mysql/mysql_com.h b/include/mysql/mysql_com.h index 2f98712..606b3df 100644 --- a/include/mysql/mysql_com.h +++ b/include/mysql/mysql_com.h @@ -32,8 +32,8 @@ #define NAME_CHAR_LEN 64 #define NAME_LEN 256 /* Field/table name length */ #define HOSTNAME_LENGTH 60 -#define SYSTEM_MB_MAX_CHAR_LENGTH 3 -#define USERNAME_CHAR_LENGTH 16 +#define SYSTEM_MB_MAX_CHAR_LENGTH 4 +#define USERNAME_CHAR_LENGTH 128 #define USERNAME_LENGTH USERNAME_CHAR_LENGTH * SYSTEM_MB_MAX_CHAR_LENGTH #define SERVER_VERSION_LENGTH 60 #define SQLSTATE_LENGTH 5 @@ -173,8 +173,9 @@ enum enum_server_command CLIENT_MULTI_STATEMENTS |\ CLIENT_MULTI_RESULTS |\ CLIENT_PROGRESS |\ - CLIENT_SSL_VERIFY_SERVER_CERT |\ + CLIENT_SSL_VERIFY_SERVER_CERT |\ CLIENT_REMEMBER_OPTIONS |\ + CLIENT_PLUGIN_AUTH |\ CLIENT_CONNECT_ATTRS) #define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD |\ @@ -283,7 +284,7 @@ enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY, MYSQL_TYPE_TINY_BLOB=249, MYSQL_TYPE_MEDIUM_BLOB=250, MYSQL_TYPE_LONG_BLOB=251, - MYSQL_TYPE_BLOB=252,MYSQL_TYPE_JSON=245, + MYSQL_TYPE_BLOB=252, MYSQL_TYPE_VAR_STRING=253, MYSQL_TYPE_STRING=254, MYSQL_TYPE_GEOMETRY=255, @@ -313,7 +314,6 @@ enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY, #define FIELD_TYPE_MEDIUM_BLOB MYSQL_TYPE_MEDIUM_BLOB #define FIELD_TYPE_LONG_BLOB MYSQL_TYPE_LONG_BLOB #define FIELD_TYPE_BLOB MYSQL_TYPE_BLOB -#define FIELD_TYPE_JSON MYSQL_TYPE_JSON #define FIELD_TYPE_VAR_STRING MYSQL_TYPE_VAR_STRING #define FIELD_TYPE_STRING MYSQL_TYPE_STRING #define FIELD_TYPE_GEOMETRY MYSQL_TYPE_GEOMETRY @@ -385,7 +385,6 @@ char *scramble_323(char *to,const char *message,const char *password); void my_scramble_41(const unsigned char *buffer, const char *scramble, const char *password); my_bool check_scramble(const char *, const char *message, unsigned long *salt,my_bool old_ver); -char *get_tty_password(char *opt_message); void hash_password(unsigned long *result, const char *password, size_t len); /* Some other useful functions */ diff --git a/include/mysql/mysql_version.h b/include/mysql/mysql_version.h index 33ec8e7..29b8771 100644 --- a/include/mysql/mysql_version.h +++ b/include/mysql/mysql_version.h @@ -7,16 +7,16 @@ #include #else #define PROTOCOL_VERSION 10 -#define MYSQL_CLIENT_VERSION "5.5.0" -#define MYSQL_SERVER_VERSION "5.5.0" +#define MYSQL_CLIENT_VERSION "5.5.1" +#define MYSQL_SERVER_VERSION "5.5.1" #define MYSQL_SERVER_SUFFIX "" #define FRM_VER -#define MYSQL_VERSION_ID 50500 +#define MYSQL_VERSION_ID 50501 #define MYSQL_PORT 3306 #define MYSQL_UNIX_ADDR "/tmp/mysql.sock" #define MYSQL_CONFIG_NAME "my" -#define MARIADB_PACKAGE_VERSION "2.0.0" +#define MARIADB_PACKAGE_VERSION "2.3.1" #define MARIADB_SYSTEM_TYPE "Windows" #define MARIADB_MACHINE_TYPE "AMD64" diff --git a/include/mysql/mysql_version.h.in b/include/mysql/mysql_version.h.in new file mode 100644 index 0000000..2e9eb6f --- /dev/null +++ b/include/mysql/mysql_version.h.in @@ -0,0 +1,28 @@ +/* Copyright Abandoned 1996, 1999, 2001 MySQL AB + This file is public domain and comes with NO WARRANTY of any kind */ + +/* Version numbers for protocol & mysqld */ + +#ifdef _CUSTOMCONFIG_ +#include +#else +#define PROTOCOL_VERSION @PROTOCOL_VERSION@ +#define MYSQL_CLIENT_VERSION "@MYSQL_CLIENT_VERSION@" +#define MYSQL_SERVER_VERSION "@MYSQL_CLIENT_VERSION@" +#define MYSQL_SERVER_SUFFIX "@MYSQL_SERVER_SUFFIX@" +#define FRM_VER @DOT_FRM_VERSION@ +#define MYSQL_VERSION_ID @MYSQL_VERSION_ID@ +#define MYSQL_PORT @MYSQL_PORT@ +#define MYSQL_UNIX_ADDR "@MYSQL_UNIX_ADDR@" +#define MYSQL_CONFIG_NAME "my" + +#define MARIADB_PACKAGE_VERSION "@CPACK_PACKAGE_VERSION@" +#define MARIADB_SYSTEM_TYPE "@CMAKE_SYSTEM_NAME@" +#define MARIADB_MACHINE_TYPE "@CMAKE_SYSTEM_PROCESSOR@" + +/* mysqld compile time options */ +#ifndef MYSQL_CHARSET +#define MYSQL_CHARSET "@default_charset@" +#endif +#endif + diff --git a/include/mysql/violite.h b/include/mysql/violite.h index 61a2e0f..cc66a77 100644 --- a/include/mysql/violite.h +++ b/include/mysql/violite.h @@ -87,7 +87,8 @@ size_t vio_write(Vio* vio, const gptr buf, size_t size); * Whenever the socket is set to blocking mode or not. */ int vio_blocking( Vio* vio, - my_bool onoff); + my_bool onoff, + my_bool *prevmode); my_bool vio_is_blocking( Vio* vio); /* * setsockopt TCP_NODELAY at IPPROTO_TCP level, when possible. @@ -135,6 +136,7 @@ void vio_in_addr(Vio *vio, struct in_addr *in); /* Return 1 if there is data to be read */ my_bool vio_poll_read(Vio *vio,uint timeout); +int vio_wait_or_timeout(Vio *vio, my_bool is_read, int timeout); struct st_vio @@ -146,7 +148,8 @@ struct st_vio struct sockaddr_in local; /* Local internet address */ struct sockaddr_in remote; /* Remote internet address */ struct mysql_async_context *async_context; /* For non-blocking API */ - + int write_timeout; + int read_timeout; enum enum_vio_type type; /* Type of connection */ char desc[30]; /* String description */ #ifdef HAVE_OPENSSL diff --git a/lib/win32/debug/dialog.dll b/lib/win32/debug/dialog.dll index c274fd1..ca7bef4 100644 Binary files a/lib/win32/debug/dialog.dll and b/lib/win32/debug/dialog.dll differ diff --git a/lib/win32/debug/mariadbclient.lib b/lib/win32/debug/mariadbclient.lib index c1ba034..517ce40 100644 Binary files a/lib/win32/debug/mariadbclient.lib and b/lib/win32/debug/mariadbclient.lib differ diff --git a/lib/win32/debug/mysql_clear_password.dll b/lib/win32/debug/mysql_clear_password.dll index 2e5c1fa..0e60297 100644 Binary files a/lib/win32/debug/mysql_clear_password.dll and b/lib/win32/debug/mysql_clear_password.dll differ diff --git a/lib/win32/release/dialog.dll b/lib/win32/release/dialog.dll index 7f91af5..bab6c09 100644 Binary files a/lib/win32/release/dialog.dll and b/lib/win32/release/dialog.dll differ diff --git a/lib/win32/release/mariadbclient.lib b/lib/win32/release/mariadbclient.lib index 62c2070..cf0607d 100644 Binary files a/lib/win32/release/mariadbclient.lib and b/lib/win32/release/mariadbclient.lib differ diff --git a/lib/win32/release/mysql_clear_password.dll b/lib/win32/release/mysql_clear_password.dll index 62a2da0..66dfeaa 100644 Binary files a/lib/win32/release/mysql_clear_password.dll and b/lib/win32/release/mysql_clear_password.dll differ diff --git a/lib/x64/debug/dialog.dll b/lib/x64/debug/dialog.dll index 856502c..98432aa 100644 Binary files a/lib/x64/debug/dialog.dll and b/lib/x64/debug/dialog.dll differ diff --git a/lib/x64/debug/mariadbclient.lib b/lib/x64/debug/mariadbclient.lib index 0145109..af309cd 100644 Binary files a/lib/x64/debug/mariadbclient.lib and b/lib/x64/debug/mariadbclient.lib differ diff --git a/lib/x64/debug/mysql_clear_password.dll b/lib/x64/debug/mysql_clear_password.dll index b950bb7..a5a5226 100644 Binary files a/lib/x64/debug/mysql_clear_password.dll and b/lib/x64/debug/mysql_clear_password.dll differ diff --git a/lib/x64/release/dialog.dll b/lib/x64/release/dialog.dll index bc52080..f66df69 100644 Binary files a/lib/x64/release/dialog.dll and b/lib/x64/release/dialog.dll differ diff --git a/lib/x64/release/mariadbclient.lib b/lib/x64/release/mariadbclient.lib index 5701fa5..53e60a3 100644 Binary files a/lib/x64/release/mariadbclient.lib and b/lib/x64/release/mariadbclient.lib differ diff --git a/lib/x64/release/mysql_clear_password.dll b/lib/x64/release/mysql_clear_password.dll index 052b473..f686f7c 100644 Binary files a/lib/x64/release/mysql_clear_password.dll and b/lib/x64/release/mysql_clear_password.dll differ diff --git a/src/ExportData.cpp b/src/ExportData.cpp index 94fdb34..0dbee97 100644 --- a/src/ExportData.cpp +++ b/src/ExportData.cpp @@ -1742,6 +1742,7 @@ CExportResultSet::DisableOtherOptions() EnableWindow(GetDlgItem(m_hwnd, IDC_HTML), FALSE); EnableWindow(GetDlgItem(m_hwnd, IDC_EXCEL), FALSE); EnableWindow(GetDlgItem(m_hwnd, IDC_SQL), FALSE); + EnableWindow(GetDlgItem(m_hwnd, IDC_JSON), FALSE); EnableWindow(GetDlgItem(m_hwnd, IDC_EXPORTFILENAME), FALSE); @@ -1763,6 +1764,7 @@ CExportResultSet::EnableOtherOptions() EnableWindow(GetDlgItem(m_hwnd, IDC_HTML), TRUE); EnableWindow(GetDlgItem(m_hwnd, IDC_EXCEL), TRUE); EnableWindow(GetDlgItem(m_hwnd, IDC_SQL), TRUE); + EnableWindow(GetDlgItem(m_hwnd, IDC_JSON), TRUE); EnableWindow(GetDlgItem(m_hwnd, IDC_EXPORTFILENAME), TRUE); diff --git a/src/MDIWindow.cpp b/src/MDIWindow.cpp index c30377f..9d6405b 100644 --- a/src/MDIWindow.cpp +++ b/src/MDIWindow.cpp @@ -170,7 +170,7 @@ MDIWindow::~MDIWindow() delete m_acinterface; delete m_pcqueryobject; delete m_pcqueryvsplitter; - delete m_listtabeditor; + // delete m_listtabeditor; if(m_tunnel) delete m_tunnel; diff --git a/src/wyIni.cpp b/src/wyIni.cpp index 6125d64..3f4db8e 100644 --- a/src/wyIni.cpp +++ b/src/wyIni.cpp @@ -1193,7 +1193,7 @@ wyIni::RemoveSection(const wyChar *sec) while (esection != NULL) { - if(strcmp(esection->m_next->m_name.GetString(),sec) == 0) + if(esection->m_next != NULL && strcmp(esection->m_next->m_name.GetString(),sec) == 0) { RemoveAll(esection->m_next); temp = esection->m_next;