Hello community, here is the log from the commit of package mariadb-connector-c for openSUSE:Factory checked in at 2020-07-09 17:49:01 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/mariadb-connector-c (Old) and /work/SRC/openSUSE:Factory/.mariadb-connector-c.new.3060 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "mariadb-connector-c" Thu Jul 9 17:49:01 2020 rev:25 rq:818996 version:3.1.9 Changes: -------- --- /work/SRC/openSUSE:Factory/mariadb-connector-c/mariadb-connector-c.changes 2020-06-03 20:30:34.176817403 +0200 +++ /work/SRC/openSUSE:Factory/.mariadb-connector-c.new.3060/mariadb-connector-c.changes 2020-07-09 17:49:05.597448271 +0200 @@ -1,0 +2,10 @@ +Fri Jul 3 11:57:03 UTC 2020 - Kristyna Streitova <kstreit...@suse.com> + +- Update to release 3.1.9 + * CONC-469: Use servers preferred authentication method unless + another plugin was specified. + * Added support for kFreeBSD builds + * Fixed memory leak in GnuTLS if connection couldn't be established. +- refresh private_library.patch + +------------------------------------------------------------------- Old: ---- mariadb-connector-c-3.1.8-src.tar.gz mariadb-connector-c-3.1.8-src.tar.gz.asc New: ---- mariadb-connector-c-3.1.9-src.tar.gz mariadb-connector-c-3.1.9-src.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mariadb-connector-c.spec ++++++ --- /var/tmp/diff_new_pack.w8OJNf/_old 2020-07-09 17:49:06.253450267 +0200 +++ /var/tmp/diff_new_pack.w8OJNf/_new 2020-07-09 17:49:06.253450267 +0200 @@ -25,7 +25,7 @@ %endif %bcond_with sqlite3 Name: mariadb-connector-c -Version: 3.1.8 +Version: 3.1.9 Release: 0 Summary: MariaDB connector in C License: LGPL-2.1-or-later ++++++ mariadb-connector-c-3.1.8-src.tar.gz -> mariadb-connector-c-3.1.9-src.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/CMakeLists.txt new/mariadb-connector-c-3.1.9-src/CMakeLists.txt --- old/mariadb-connector-c-3.1.8-src/CMakeLists.txt 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/CMakeLists.txt 2020-06-18 17:16:18.000000000 +0200 @@ -36,7 +36,7 @@ SET(CPACK_PACKAGE_VERSION_MAJOR 3) SET(CPACK_PACKAGE_VERSION_MINOR 1) -SET(CPACK_PACKAGE_VERSION_PATCH 8) +SET(CPACK_PACKAGE_VERSION_PATCH 9) SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") MATH(EXPR MARIADB_PACKAGE_VERSION_ID "${CPACK_PACKAGE_VERSION_MAJOR} * 10000 + ${CPACK_PACKAGE_VERSION_MINOR} * 100 + @@ -60,7 +60,7 @@ ENDIF() ADD_OPTION(WITH_UNIT_TESTS "build test suite" ON) -ADD_OPTION(WITH_DYNCOL "Enables support of dynamic coluumns" ON) +ADD_OPTION(WITH_DYNCOL "Enables support of dynamic columns" ON) ADD_OPTION(WITH_EXTERNAL_ZLIB "Enables use of external zlib" OFF) ADD_OPTION(WITH_CURL "Enables use of curl" ON) ADD_OPTION(WITH_SSL "Enables use of TLS/SSL library" ON) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/cmake/CheckFunctions.cmake new/mariadb-connector-c-3.1.9-src/cmake/CheckFunctions.cmake --- old/mariadb-connector-c-3.1.8-src/cmake/CheckFunctions.cmake 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/cmake/CheckFunctions.cmake 2020-06-18 17:16:18.000000000 +0200 @@ -22,4 +22,9 @@ CHECK_FUNCTION_EXISTS (setlocale HAVE_SETLOCALE) CHECK_FUNCTION_EXISTS (poll HAVE_POLL) CHECK_FUNCTION_EXISTS (getpwuid HAVE_GETPWUID) -CHECK_FUNCTION_EXISTS (cuserid HAVE_CUSERID) + +IF(HAVE_FILE_UCONTEXT_H) + CHECK_FUNCTION_EXISTS (makecontext HAVE_UCONTEXT_H) +ENDIF() + +CHECK_FUNCTION_EXISTS (cuserid HAVE_CUSERID) \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/cmake/CheckIncludeFiles.cmake new/mariadb-connector-c-3.1.9-src/cmake/CheckIncludeFiles.cmake --- old/mariadb-connector-c-3.1.8-src/cmake/CheckIncludeFiles.cmake 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/cmake/CheckIncludeFiles.cmake 2020-06-18 17:16:18.000000000 +0200 @@ -46,4 +46,8 @@ CHECK_INCLUDE_FILES (sys/un.h HAVE_SYS_UN_H) CHECK_INCLUDE_FILES (unistd.h HAVE_UNISTD_H) CHECK_INCLUDE_FILES (utime.h HAVE_UTIME_H) -CHECK_INCLUDE_FILES (ucontext.h HAVE_UCONTEXT_H) + +CHECK_INCLUDE_FILES (ucontext.h HAVE_FILE_UCONTEXT_H) +IF(NOT HAVE_FILE_UCONTEXT_H) + CHECK_INCLUDE_FILES (sys/ucontext.h HAVE_FILE_UCONTEXT_H) +ENDIF() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/include/ma_common.h new/mariadb-connector-c-3.1.9-src/include/ma_common.h --- old/mariadb-connector-c-3.1.8-src/include/ma_common.h 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/include/ma_common.h 2020-06-18 17:16:18.000000000 +0200 @@ -109,8 +109,8 @@ }; #define OPT_EXT_VAL(a,key) \ - ((a)->options.extension && (a)->options.extension->key) ?\ - (a)->options.extension->key : 0 + (((a)->options.extension && (a)->options.extension->key) ?\ + (a)->options.extension->key : 0) #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/include/ma_global.h new/mariadb-connector-c-3.1.9-src/include/ma_global.h --- old/mariadb-connector-c-3.1.8-src/include/ma_global.h 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/include/ma_global.h 2020-06-18 17:16:18.000000000 +0200 @@ -250,7 +250,7 @@ #if defined(_lint) || defined(FORCE_INIT_OF_VARS) -#define LINT_INIT(var) var=0 /* No uninitialize-warning */ +#define LINT_INIT(var) do{var=0;}while(0) /* No uninitialize-warning */ #define LINT_INIT_STRUCT(var) memset(&var, 0, sizeof(var)) /* No uninitialize-warning */ #else #define LINT_INIT(var) @@ -272,10 +272,10 @@ #endif #define sgn(a) (((a) < 0) ? -1 : ((a) > 0) ? 1 : 0) -#define swap(t,a,b) { register t dummy; dummy = a; a = b; b = dummy; } +#define swap(t,a,b) do{register t dummy; dummy = a; a = b; b = dummy;}while(0) #define test(a) ((a) ? 1 : 0) -#define set_if_bigger(a,b) { if ((a) < (b)) (a)=(b); } -#define set_if_smaller(a,b) { if ((a) > (b)) (a)=(b); } +#define set_if_bigger(a,b) do{ if ((a) < (b)) (a)=(b); }while(0) +#define set_if_smaller(a,b) do{ if ((a) > (b)) (a)=(b); }while(0) #define test_all_bits(a,b) (((a) & (b)) == (b)) #define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1)) #define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0]))) @@ -440,11 +440,11 @@ */ #define MALLOC_OVERHEAD 8 /* get memory in huncs */ -#define ONCE_ALLOC_INIT (uint) (4096-MALLOC_OVERHEAD) +#define ONCE_ALLOC_INIT ((uint) (4096-MALLOC_OVERHEAD)) /* Typical record cash */ -#define RECORD_CACHE_SIZE (uint) (64*1024-MALLOC_OVERHEAD) +#define RECORD_CACHE_SIZE ((uint) (64*1024-MALLOC_OVERHEAD)) /* Typical key cash */ -#define KEY_CACHE_SIZE (uint) (8*1024*1024-MALLOC_OVERHEAD) +#define KEY_CACHE_SIZE ((uint) (8*1024*1024-MALLOC_OVERHEAD)) /* Some things that this system doesn't have */ @@ -815,7 +815,7 @@ *((T)+3)=(uchar) (((A) >> 24)); \ *((T)+4)=(uchar) (((A) >> 32)); \ *((T)+5)=(uchar) (((A) >> 40)); } while(0) -#define int8store(T,A) *((ulonglong *) (T))= (ulonglong) (A) +#define int8store(T,A) do {*((ulonglong *) (T))= (ulonglong) (A);} while(0) typedef union { double v; @@ -1046,11 +1046,11 @@ #endif /* WORDS_BIGENDIAN */ #ifndef THREAD -#define thread_safe_increment(V,L) (V)++ -#define thread_safe_add(V,C,L) (V)+=(C) -#define thread_safe_sub(V,C,L) (V)-=(C) -#define statistic_increment(V,L) (V)++ -#define statistic_add(V,C,L) (V)+=(C) +#define thread_safe_increment(V,L) ((V)++) +#define thread_safe_add(V,C,L) ((V)+=(C)) +#define thread_safe_sub(V,C,L) ((V)-=(C)) +#define statistic_increment(V,L) ((V)++) +#define statistic_add(V,C,L) ((V)+=(C)) #endif #ifdef _WIN32 @@ -1069,9 +1069,9 @@ #ifdef HAVE_DLOPEN #ifdef _WIN32 -#define dlsym(lib, name) GetProcAddress((HMODULE)lib, name) +#define dlsym(lib, name) GetProcAddress((HMODULE)(lib), name) #define dlopen(libname, unused) LoadLibraryEx(libname, NULL, 0) -#define dlclose(lib) FreeLibrary((HMODULE)lib) +#define dlclose(lib) FreeLibrary((HMODULE)(lib)) #elif defined(HAVE_DLFCN_H) #include <dlfcn.h> #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/include/ma_list.h new/mariadb-connector-c-3.1.9-src/include/ma_list.h --- old/mariadb-connector-c-3.1.8-src/include/ma_list.h 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/include/ma_list.h 2020-06-18 17:16:18.000000000 +0200 @@ -39,7 +39,7 @@ #define list_rest(a) ((a)->next) #define list_push(a,b) (a)=list_cons((b),(a)) -#define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old) ; ma_free((char *) old,MYF(MY_FAE)); } +#define list_pop(A) do {LIST *old=(A); (A)=list_delete(old,old) ; ma_free((char *) old,MYF(MY_FAE)); } while(0) #ifdef __cplusplus } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/include/ma_sys.h new/mariadb-connector-c-3.1.9-src/include/ma_sys.h --- old/mariadb-connector-c-3.1.8-src/include/ma_sys.h 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/include/ma_sys.h 2020-06-18 17:16:18.000000000 +0200 @@ -35,9 +35,21 @@ #include <stdarg.h> -#define MYSYS_PROGRAM_USES_CURSES() { ma_error_handler_hook = ma_message_curses; mysys_uses_curses=1; } -#define MYSYS_PROGRAM_DONT_USE_CURSES() { ma_error_handler_hook = ma_message_no_curses; mysys_uses_curses=0;} -#define MY_INIT(name); { ma_progname= name; ma_init(); } +#define MYSYS_PROGRAM_USES_CURSES() \ +do {\ + ma_error_handler_hook = ma_message_curses;\ + mysys_uses_curses=1;\ +} while(0) +#define MYSYS_PROGRAM_DONT_USE_CURSES() \ +do {\ + ma_error_handler_hook = ma_message_no_curses; \ + mysys_uses_curses=0; \ +} while(0) +#define MY_INIT(name) \ +do {\ + ma_progname= name;\ + ma_init();\ +} while(0) #define MAXMAPS (4) /* Number of error message maps */ #define ERRMOD (1000) /* Max number of errors in a map */ @@ -285,15 +297,15 @@ /* defines for mf_iocache */ /* Test if buffer is inited */ -#define my_b_clear(info) (info)->buffer=0 -#define my_b_inited(info) (info)->buffer +#define my_b_clear(info) do{(info)->buffer= 0;} while (0) +#define my_b_inited(info) ((info)->buffer) #define my_b_EOF INT_MIN #define my_b_read(info,Buffer,Count) \ ((info)->rc_pos + (Count) <= (info)->rc_end ?\ - (memcpy(Buffer,(info)->rc_pos,(size_t) (Count)), \ + (memcpy((Buffer),(info)->rc_pos,(size_t) (Count)), \ ((info)->rc_pos+=(Count)),0) :\ - (*(info)->read_function)((info),Buffer,Count)) + (*(info)->read_function)((info),(Buffer),(Count))) #define my_b_get(info) \ ((info)->rc_pos != (info)->rc_end ?\ @@ -302,18 +314,18 @@ #define my_b_write(info,Buffer,Count) \ ((info)->rc_pos + (Count) <= (info)->rc_end ?\ - (memcpy((info)->rc_pos,Buffer,(size_t) (Count)), \ + (memcpy((info)->rc_pos,(Buffer),(size_t) (Count)), \ ((info)->rc_pos+=(Count)),0) :\ - _my_b_write(info,Buffer,Count)) + _my_b_write((info),(Buffer),(Count))) /* my_b_write_byte doesn't have any err-check */ #define my_b_write_byte(info,chr) \ (((info)->rc_pos < (info)->rc_end) ?\ ((*(info)->rc_pos++)=(chr)) :\ - (_my_b_write(info,0,0) , ((*(info)->rc_pos++)=(chr)))) + (_my_b_write((info),0,0) , ((*(info)->rc_pos++)=(chr)))) #define my_b_fill_cache(info) \ - (((info)->rc_end=(info)->rc_pos),(*(info)->read_function)(info,0,0)) + (((info)->rc_end=(info)->rc_pos),(*(info)->read_function)((info),0,0)) #define my_b_tell(info) ((info)->pos_in_file + \ ((info)->rc_pos - (info)->rc_request_pos)) @@ -401,7 +413,7 @@ extern void case_sort(my_string str,uint length); extern uint ma_dirname_part(my_string to,const char *name); extern uint ma_dirname_length(const char *name); -#define base_name(A) (A+dirname_length(A)) +#define base_name(A) ((A)+dirname_length(A)) extern int test_if_hard_path(const char *dir_name); extern char *ma_convert_dirname(my_string name); extern void to_unix_path(my_string name); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/include/mariadb_com.h new/mariadb-connector-c-3.1.9-src/include/mariadb_com.h --- old/mariadb-connector-c-3.1.8-src/include/mariadb_com.h 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/include/mariadb_com.h 2020-06-18 17:16:18.000000000 +0200 @@ -34,7 +34,7 @@ #define HOSTNAME_LENGTH 60 #define SYSTEM_MB_MAX_CHAR_LENGTH 4 #define USERNAME_CHAR_LENGTH 128 -#define USERNAME_LENGTH USERNAME_CHAR_LENGTH * SYSTEM_MB_MAX_CHAR_LENGTH +#define USERNAME_LENGTH (USERNAME_CHAR_LENGTH * SYSTEM_MB_MAX_CHAR_LENGTH) #define SERVER_VERSION_LENGTH 60 #define SQLSTATE_LENGTH 5 #define SCRAMBLE_LENGTH 20 @@ -174,7 +174,7 @@ #define MARIADB_CLIENT_EXTENDED_METADATA (1ULL << 35) #define IS_MARIADB_EXTENDED_SERVER(mysql)\ - !(mysql->server_capabilities & CLIENT_MYSQL) + (!(mysql->server_capabilities & CLIENT_MYSQL)) #define MARIADB_CLIENT_SUPPORTED_FLAGS (MARIADB_CLIENT_PROGRESS |\ MARIADB_CLIENT_COM_MULTI |\ @@ -239,7 +239,7 @@ #define MYSQL_ERRMSG_SIZE 512 #define NET_READ_TIMEOUT 30 /* Timeout on read */ #define NET_WRITE_TIMEOUT 60 /* Timeout on write */ -#define NET_WAIT_TIMEOUT 8*60*60 /* Wait for new query */ +#define NET_WAIT_TIMEOUT (8*60*60) /* Wait for new query */ /* for server integration (mysqlbinlog) */ #define LIST_PROCESS_HOST_LEN 64 @@ -316,7 +316,7 @@ #define SESSION_TRACK_BEGIN 0 #define SESSION_TRACK_END SESSION_TRACK_TRANSACTION_TYPE -#define SESSION_TRACK_TYPES SESSION_TRACK_END + 1 +#define SESSION_TRACK_TYPES (SESSION_TRACK_END + 1) enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY, MYSQL_TYPE_SHORT, MYSQL_TYPE_LONG, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/include/mariadb_dyncol.h new/mariadb-connector-c-3.1.9-src/include/mariadb_dyncol.h --- old/mariadb-connector-c-3.1.8-src/include/mariadb_dyncol.h 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/include/mariadb_dyncol.h 2020-06-18 17:16:18.000000000 +0200 @@ -242,7 +242,10 @@ enum enum_dyncol_func_result mariadb_dyncol_column_count(DYNAMIC_COLUMN *str, uint *column_count); -#define mariadb_dyncol_value_init(V) (V)->type= DYN_COL_NULL +#define mariadb_dyncol_value_init(V) \ +do {\ + (V)->type= DYN_COL_NULL;\ +} while(0) /* Prepare value for using as decimal diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/include/mariadb_stmt.h new/mariadb-connector-c-3.1.9-src/include/mariadb_stmt.h --- old/mariadb-connector-c-3.1.8-src/include/mariadb_stmt.h 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/include/mariadb_stmt.h 2020-06-18 17:16:18.000000000 +0200 @@ -35,20 +35,20 @@ (MARIADB_CLIENT_STMT_BULK_OPERATIONS >> 32)))) #define SET_CLIENT_STMT_ERROR(a, b, c, d) \ -{ \ +do { \ (a)->last_errno= (b);\ strncpy((a)->sqlstate, (c), SQLSTATE_LENGTH);\ (a)->sqlstate[SQLSTATE_LENGTH]= 0;\ strncpy((a)->last_error, (d) ? (d) : ER((b)), MYSQL_ERRMSG_SIZE);\ (a)->last_error[MYSQL_ERRMSG_SIZE - 1]= 0;\ -} +} while (0) #define CLEAR_CLIENT_STMT_ERROR(a) \ -{ \ +do { \ (a)->last_errno= 0;\ strcpy((a)->sqlstate, "00000");\ (a)->last_error[0]= 0;\ -} +} while (0) #define MYSQL_PS_SKIP_RESULT_W_LEN -1 #define MYSQL_PS_SKIP_RESULT_STR -2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/include/mysql.h new/mariadb-connector-c-3.1.9-src/include/mysql.h --- old/mariadb-connector-c-3.1.8-src/include/mysql.h 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/include/mysql.h 2020-06-18 17:16:18.000000000 +0200 @@ -130,13 +130,13 @@ typedef unsigned int MYSQL_FIELD_OFFSET; /* offset to current field */ #define SET_CLIENT_ERROR(a, b, c, d) \ - { \ + do { \ (a)->net.last_errno= (b);\ strncpy((a)->net.sqlstate, (c), SQLSTATE_LENGTH);\ (a)->net.sqlstate[SQLSTATE_LENGTH]= 0;\ strncpy((a)->net.last_error, (d) ? (d) : ER((b)), MYSQL_ERRMSG_SIZE - 1);\ (a)->net.last_error[MYSQL_ERRMSG_SIZE - 1]= 0;\ - } + } while(0) /* For mysql_async.c */ #define set_mariadb_error(A,B,C) SET_CLIENT_ERROR((A),(B),(C),0) @@ -144,12 +144,12 @@ #define unknown_sqlstate SQLSTATE_UNKNOWN #define CLEAR_CLIENT_ERROR(a) \ - { \ + do { \ (a)->net.last_errno= 0;\ strcpy((a)->net.sqlstate, "00000");\ (a)->net.last_error[0]= '\0';\ (a)->net.extension->extended_errno= 0;\ - } + } while (0) #define MYSQL_COUNT_ERROR (~(unsigned long long) 0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/libmariadb/CMakeLists.txt new/mariadb-connector-c-3.1.9-src/libmariadb/CMakeLists.txt --- old/mariadb-connector-c-3.1.8-src/libmariadb/CMakeLists.txt 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/libmariadb/CMakeLists.txt 2020-06-18 17:16:18.000000000 +0200 @@ -412,6 +412,7 @@ ENDIF() IF(CMAKE_SYSTEM_NAME MATCHES "Linux" OR + CMAKE_SYSTEM_NAME MATCHES "kFreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "GNU") IF (NOT WITH_ASAN AND NOT WITH_TSAN AND NOT WITH_UBSAN AND NOT WITH_MSAN) TARGET_LINK_LIBRARIES (libmariadb LINK_PRIVATE "-Wl,--no-undefined") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/libmariadb/ma_charset.c new/mariadb-connector-c-3.1.9-src/libmariadb/ma_charset.c --- old/mariadb-connector-c-3.1.8-src/libmariadb/ma_charset.c 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/libmariadb/ma_charset.c 2020-06-18 17:16:18.000000000 +0200 @@ -1,5 +1,5 @@ /**************************************************************************** - Copyright (C) 2012 Monty Program AB + Copyright (C) 2012, 2020, MariaDB Corporation. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -1403,7 +1403,8 @@ else { /* Not our client - copy as is*/ - strncpy(buffer, cs_name, buff_len); + strncpy(buffer, cs_name, buff_len - 1); + buffer[buff_len - 1]= '\0'; } if (target_cs) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/libmariadb/ma_dtoa.c new/mariadb-connector-c-3.1.9-src/libmariadb/ma_dtoa.c --- old/mariadb-connector-c-3.1.8-src/libmariadb/ma_dtoa.c 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/libmariadb/ma_dtoa.c 2020-06-18 17:16:18.000000000 +0200 @@ -514,14 +514,14 @@ #if defined(HAVE_BIGENDIAN) || defined(WORDS_BIGENDIAN) || \ (defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)) -#define word0(x) (x)->L[0] -#define word1(x) (x)->L[1] +#define word0(x) ((x)->L[0]) +#define word1(x) ((x)->L[1]) #else -#define word0(x) (x)->L[1] -#define word1(x) (x)->L[0] +#define word0(x) ((x)->L[1]) +#define word1(x) ((x)->L[0]) #endif -#define dval(x) (x)->d +#define dval(x) ((x)->d) /* #define P DBL_MANT_DIG */ /* Ten_pmax= floor(P*log(2)/log(5)) */ @@ -568,8 +568,8 @@ #define Rounding Flt_Rounds #endif -#define rounded_product(a,b) a*= b -#define rounded_quotient(a,b) a/= b +#define rounded_product(a,b) ((a)*= (b)) +#define rounded_quotient(a,b) ((a)/= (b)) #define Big0 (Frac_mask1 | Exp_msk1*(DBL_MAX_EXP+Bias-1)) #define Big1 0xffffffff @@ -579,8 +579,8 @@ #define Kmax 15 -#define Bcopy(x,y) memcpy((char *)&x->sign, (char *)&y->sign, \ - 2*sizeof(int) + y->wds*sizeof(ULong)) +#define Bcopy(x,y) memcpy((char *)&(x)->sign, (char *)&(y)->sign, \ + 2*sizeof(int) + (y)->wds*sizeof(ULong)) /* Arbitrary-length integer */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/libmariadb/ma_stmt_codec.c new/mariadb-connector-c-3.1.9-src/libmariadb/ma_stmt_codec.c --- old/mariadb-connector-c-3.1.8-src/libmariadb/ma_stmt_codec.c 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/libmariadb/ma_stmt_codec.c 2020-06-18 17:16:18.000000000 +0200 @@ -73,7 +73,7 @@ #define LONGLONG_MAX ((long long) 0x7FFFFFFFFFFFFFFFLL) #endif -#define MAX_DBL_STR 3 + DBL_MANT_DIG - DBL_MIN_EXP +#define MAX_DBL_STR (3 + DBL_MANT_DIG - DBL_MIN_EXP) #if defined(HAVE_LONG_LONG) && !defined(ULONGLONG_MAX) /* First check for ANSI C99 definition: */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/libmariadb/mariadb_async.c new/mariadb-connector-c-3.1.9-src/libmariadb/mariadb_async.c --- old/mariadb-connector-c-3.1.8-src/libmariadb/mariadb_async.c 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/libmariadb/mariadb_async.c 2020-06-18 17:16:18.000000000 +0200 @@ -40,10 +40,10 @@ Windows does not support MSG_DONTWAIT for send()/recv(). So we need to ensure that the socket is non-blocking at the start of every operation. */ -#define WIN_SET_NONBLOCKING(mysql) { \ +#define WIN_SET_NONBLOCKING(mysql) do { \ my_bool old_mode; \ if ((mysql)->net.pvio) ma_pvio_blocking((mysql)->net.pvio, FALSE, &old_mode); \ - } + } while(0); #else #define WIN_SET_NONBLOCKING(mysql) #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/libmariadb/mariadb_stmt.c new/mariadb-connector-c-3.1.9-src/libmariadb/mariadb_stmt.c --- old/mariadb-connector-c-3.1.8-src/libmariadb/mariadb_stmt.c 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/libmariadb/mariadb_stmt.c 2020-06-18 17:16:18.000000000 +0200 @@ -61,7 +61,7 @@ #define UPDATE_STMT_ERROR(stmt)\ SET_CLIENT_STMT_ERROR((stmt), (stmt)->mysql->net.last_errno, (stmt)->mysql->net.sqlstate, (stmt)->mysql->net.last_error) -#define STMT_NUM_OFS(type, a,r) ((type *)(a))[r] +#define STMT_NUM_OFS(type, a, r) (((type *)(a))[r]) #define MADB_RESET_ERROR 1 #define MADB_RESET_LONGDATA 2 #define MADB_RESET_SERVER 4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/libmariadb/secure/gnutls.c new/mariadb-connector-c-3.1.9-src/libmariadb/secure/gnutls.c --- old/mariadb-connector-c-3.1.8-src/libmariadb/secure/gnutls.c 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/libmariadb/secure/gnutls.c 2020-06-18 17:16:18.000000000 +0200 @@ -1233,10 +1233,9 @@ if (!mysql_errno(mysql)) ma_tls_set_error(mysql, ssl, ret); + ma_tls_close(ctls); + /* restore blocking mode */ - gnutls_deinit((gnutls_session_t )ctls->ssl); - free_gnutls_data(data); - ctls->ssl= NULL; if (!blocking) pvio->methods->blocking(pvio, FALSE, 0); return 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/libmariadb/secure/ma_schannel.c new/mariadb-connector-c-3.1.9-src/libmariadb/secure/ma_schannel.c --- old/mariadb-connector-c-3.1.8-src/libmariadb/secure/ma_schannel.c 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/libmariadb/secure/ma_schannel.c 2020-06-18 17:16:18.000000000 +0200 @@ -26,7 +26,7 @@ #define SC_IO_BUFFER_SIZE 0x4000 #define MAX_SSL_ERR_LEN 100 -#define SCHANNEL_PAYLOAD(A) (A).cbMaximumMessage + (A).cbHeader + (A).cbTrailer +#define SCHANNEL_PAYLOAD(A) ((A).cbMaximumMessage + (A).cbHeader + (A).cbTrailer) void ma_schannel_set_win_error(MARIADB_PVIO *pvio, DWORD ErrorNo); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/libmariadb/secure/schannel.c new/mariadb-connector-c-3.1.9-src/libmariadb/secure/schannel.c --- old/mariadb-connector-c-3.1.8-src/libmariadb/secure/schannel.c 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/libmariadb/secure/schannel.c 2020-06-18 17:16:18.000000000 +0200 @@ -21,9 +21,6 @@ #include "schannel_certs.h" #include <string.h> -#pragma comment (lib, "crypt32.lib") -#pragma comment (lib, "secur32.lib") - extern my_bool ma_tls_initialized; char tls_library_version[] = "Schannel"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/libmariadb/secure/win_crypt.c new/mariadb-connector-c-3.1.9-src/libmariadb/secure/win_crypt.c --- old/mariadb-connector-c-3.1.8-src/libmariadb/secure/win_crypt.c 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/libmariadb/secure/win_crypt.c 2020-06-18 17:16:18.000000000 +0200 @@ -21,8 +21,6 @@ #include <ma_crypt.h> #include <malloc.h> -#pragma comment(lib, "bcrypt.lib") - BCRYPT_ALG_HANDLE Sha256Prov= 0; BCRYPT_ALG_HANDLE Sha512Prov= 0; BCRYPT_ALG_HANDLE RsaProv= 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/plugins/auth/CMakeLists.txt new/mariadb-connector-c-3.1.9-src/plugins/auth/CMakeLists.txt --- old/mariadb-connector-c-3.1.8-src/plugins/auth/CMakeLists.txt 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/plugins/auth/CMakeLists.txt 2020-06-18 17:16:18.000000000 +0200 @@ -6,7 +6,7 @@ SET(CRYPTO_PLUGIN 1) IF(WIN32) SET(CRYPT_SOURCE ${CC_SOURCE_DIR}/libmariadb/secure/win_crypt.c) - SET(CRYPT_LIBS crypt32) + SET(CRYPT_LIBS crypt32 bcrypt) ELSEIF(WITH_SSL STREQUAL "OPENSSL") SET(CRYPT_SOURCE ${CC_SOURCE_DIR}/libmariadb/secure/openssl_crypt.c) SET(CRYPT_LIBS ${SSL_LIBRARIES}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/plugins/auth/caching_sha2_pw.c new/mariadb-connector-c-3.1.9-src/plugins/auth/caching_sha2_pw.c --- old/mariadb-connector-c-3.1.8-src/plugins/auth/caching_sha2_pw.c 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/plugins/auth/caching_sha2_pw.c 2020-06-18 17:16:18.000000000 +0200 @@ -24,8 +24,6 @@ #define HAVE_WINCRYPT #undef HAVE_OPENSSL #undef HAVE_GNUTLS -#pragma comment(lib, "crypt32.lib") -#pragma comment(lib, "ws2_32.lib") #endif #if defined(HAVE_OPENSSL) || defined(HAVE_WINCRYPT) || defined(HAVE_GNUTLS) @@ -54,8 +52,7 @@ #include <windows.h> #include <wincrypt.h> #include <bcrypt.h> -#pragma comment(lib, "bcrypt.lib") -#pragma comment(lib, "crypt32.lib") + extern BCRYPT_ALG_HANDLE RsaProv; extern BCRYPT_ALG_HANDLE Sha256Prov; #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/plugins/auth/ed25519.c new/mariadb-connector-c-3.1.9-src/plugins/auth/ed25519.c --- old/mariadb-connector-c-3.1.8-src/plugins/auth/ed25519.c 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/plugins/auth/ed25519.c 2020-06-18 17:16:18.000000000 +0200 @@ -46,8 +46,6 @@ #include <windows.h> #include <wincrypt.h> #include <bcrypt.h> -#pragma comment(lib, "bcrypt.lib") -#pragma comment(lib, "crypt32.lib") extern BCRYPT_ALG_HANDLE Sha512Prov; #elif defined(HAVE_OPENSSL) #include <openssl/rsa.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/plugins/auth/my_auth.c new/mariadb-connector-c-3.1.9-src/plugins/auth/my_auth.c --- old/mariadb-connector-c-3.1.8-src/plugins/auth/my_auth.c 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/plugins/auth/my_auth.c 2020-06-18 17:16:18.000000000 +0200 @@ -547,39 +547,37 @@ int run_plugin_auth(MYSQL *mysql, char *data, uint data_len, const char *data_plugin, const char *db) { - const char *auth_plugin_name; + const char *auth_plugin_name= NULL; auth_plugin_t *auth_plugin; MCPVIO_EXT mpvio; ulong pkt_length; int res; /* determine the default/initial plugin to use */ - if (mysql->options.extension && mysql->options.extension->default_auth && - mysql->server_capabilities & CLIENT_PLUGIN_AUTH) + if (mysql->server_capabilities & CLIENT_PLUGIN_AUTH) { - auth_plugin_name= mysql->options.extension->default_auth; - if (!(auth_plugin= (auth_plugin_t*) mysql_client_find_plugin(mysql, - auth_plugin_name, MYSQL_CLIENT_AUTHENTICATION_PLUGIN))) - auth_plugin= &dummy_fallback_client_plugin; + if (mysql->options.extension && mysql->options.extension->default_auth) + auth_plugin_name= mysql->options.extension->default_auth; + else if (data_plugin) + auth_plugin_name= data_plugin; } - else + if (!auth_plugin_name) { if (mysql->server_capabilities & CLIENT_PROTOCOL_41) - auth_plugin= &mysql_native_password_client_plugin; + auth_plugin_name= native_password_plugin_name; else - { - if (!(auth_plugin= (auth_plugin_t*)mysql_client_find_plugin(mysql, - "mysql_old_password", MYSQL_CLIENT_AUTHENTICATION_PLUGIN))) - auth_plugin= &dummy_fallback_client_plugin; - } - auth_plugin_name= auth_plugin->name; + auth_plugin_name= "mysql_old_password"; } + if (!(auth_plugin= (auth_plugin_t*) mysql_client_find_plugin(mysql, + auth_plugin_name, MYSQL_CLIENT_AUTHENTICATION_PLUGIN))) + auth_plugin= &dummy_fallback_client_plugin; mysql->net.last_errno= 0; /* just in case */ if (data_plugin && strcmp(data_plugin, auth_plugin_name)) { - /* data was prepared for a different plugin, don't show it to this one */ + /* data was prepared for a different plugin, so we don't + send any data */ data= 0; data_len= 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/plugins/auth/sha256_pw.c new/mariadb-connector-c-3.1.9-src/plugins/auth/sha256_pw.c --- old/mariadb-connector-c-3.1.8-src/plugins/auth/sha256_pw.c 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/plugins/auth/sha256_pw.c 2020-06-18 17:16:18.000000000 +0200 @@ -24,8 +24,6 @@ #undef HAVE_GNUTLS #undef HAVE_OPENSSL #define HAVE_WINCRYPT -#pragma comment(lib, "crypt32.lib") -#pragma comment(lib, "ws2_32.lib") #endif #if defined(HAVE_OPENSSL) || defined(HAVE_WINCRYPT) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/plugins/auth/sspi_common.h new/mariadb-connector-c-3.1.9-src/plugins/auth/sspi_common.h --- old/mariadb-connector-c-3.1.8-src/plugins/auth/sspi_common.h 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/plugins/auth/sspi_common.h 2020-06-18 17:16:18.000000000 +0200 @@ -34,5 +34,5 @@ #include <stdio.h> #define SSPI_MAX_TOKEN_SIZE 50000 -#define SEC_ERROR(err) (err < 0) +#define SEC_ERROR(err) ((err) < 0) extern void sspi_errmsg(int err, char *buf, size_t size); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/plugins/connection/replication.c new/mariadb-connector-c-3.1.9-src/plugins/connection/replication.c --- old/mariadb-connector-c-3.1.8-src/plugins/connection/replication.c 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/plugins/connection/replication.c 2020-06-18 17:16:18.000000000 +0200 @@ -85,16 +85,16 @@ } REPL_DATA; #define SET_SLAVE(mysql, data)\ -{\ +do {\ mysql->net.pvio= data->pvio[MARIADB_SLAVE]; \ data->current_type= MARIADB_SLAVE;\ -} +} while(0) #define SET_MASTER(mysql, data)\ -{\ +do {\ mysql->net.pvio= data->pvio[MARIADB_MASTER];\ data->current_type= MARIADB_MASTER;\ -} +} while(0) /* parse url diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/plugins/pvio/pvio_shmem.c new/mariadb-connector-c-3.1.9-src/plugins/pvio/pvio_shmem.c --- old/mariadb-connector-c-3.1.8-src/plugins/pvio/pvio_shmem.c 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/plugins/pvio/pvio_shmem.c 2020-06-18 17:16:18.000000000 +0200 @@ -29,7 +29,7 @@ #include <string.h> #include <ma_string.h> -#define PVIO_SHM_BUFFER_SIZE 16000 + 4 +#define PVIO_SHM_BUFFER_SIZE (16000 + 4) my_bool pvio_shm_set_timeout(MARIADB_PVIO *pvio, enum enum_pvio_timeout type, int timeout); int pvio_shm_get_timeout(MARIADB_PVIO *pvio, enum enum_pvio_timeout type); @@ -101,7 +101,7 @@ size_t buffer_size; } PVIO_SHM; -char *StrEvent[]= {"SERVER_WROTE", "SERVER_READ", "CLIENT_WROTE", "CLIENT_READ", "CONNECTION_CLOSED"}; +const char *StrEvent[]= {"SERVER_WROTE", "SERVER_READ", "CLIENT_WROTE", "CLIENT_READ", "CONNECTION_CLOSED"}; struct st_pvio_shm { char *shm_name; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/plugins/pvio/pvio_socket.c new/mariadb-connector-c-3.1.9-src/plugins/pvio/pvio_socket.c --- old/mariadb-connector-c-3.1.8-src/plugins/pvio/pvio_socket.c 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/plugins/pvio/pvio_socket.c 2020-06-18 17:16:18.000000000 +0200 @@ -52,7 +52,7 @@ #include <netinet/ip.h> #include <netdb.h> #include <netinet/tcp.h> -#define IS_SOCKET_EINTR(err) (err == SOCKET_EINTR) +#define IS_SOCKET_EINTR(err) ((err) == SOCKET_EINTR) #else #include <ws2tcpip.h> #define O_NONBLOCK 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/plugins/trace/trace_example.c new/mariadb-connector-c-3.1.9-src/plugins/trace/trace_example.c --- old/mariadb-connector-c-3.1.8-src/plugins/trace/trace_example.c 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/plugins/trace/trace_example.c 2020-06-18 17:16:18.000000000 +0200 @@ -116,7 +116,7 @@ unsigned long pkt_length; } TRACE_INFO; -#define TRACE_STATUS(a) (!a) ? "ok" : "error" +#define TRACE_STATUS(a) ((!a) ? "ok" : "error") TRACE_INFO *trace_info= NULL; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/unittest/libmariadb/connection.c new/mariadb-connector-c-3.1.9-src/unittest/libmariadb/connection.c --- old/mariadb-connector-c-3.1.8-src/unittest/libmariadb/connection.c 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/unittest/libmariadb/connection.c 2020-06-18 17:16:18.000000000 +0200 @@ -223,11 +223,11 @@ /* Prepare environment */ sprintf(buff, "drop database if exists %s", db); rc= mysql_query(mysql, buff); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); sprintf(buff, "create database %s", db); rc= mysql_query(mysql, buff); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); sprintf(buff, "grant select on %s.* to %s@'%%' identified by '%s'", @@ -235,14 +235,14 @@ user_pw, pw); rc= mysql_query(mysql, buff); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); sprintf(buff, "grant select on %s.* to %s@'%%'", db, user_no_pw); rc= mysql_query(mysql, buff); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); /* Try some combinations */ @@ -288,13 +288,13 @@ FAIL_UNLESS(rc, "Error expected"); rc= mysql_change_user(mysql, user_pw, pw, db); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); rc= mysql_change_user(mysql, user_pw, pw, NULL); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); rc= mysql_change_user(mysql, user_pw, pw, ""); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); rc= mysql_change_user(mysql, user_no_pw, pw, db); FAIL_UNLESS(rc, "Error expected"); @@ -306,16 +306,16 @@ FAIL_UNLESS(rc, "Error expected"); rc= mysql_change_user(mysql, user_no_pw, "", NULL); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); rc= mysql_change_user(mysql, user_no_pw, "", ""); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); rc= mysql_change_user(mysql, user_no_pw, "", db); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); rc= mysql_change_user(mysql, user_no_pw, NULL, db); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); rc= mysql_change_user(mysql, "", pw, db); FAIL_UNLESS(rc, "Error expected"); @@ -345,15 +345,15 @@ sprintf(buff, "drop database %s", db); rc= mysql_query(mysql, buff); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); sprintf(buff, "drop user %s@'%%'", user_pw); rc= mysql_query(mysql, buff); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); sprintf(buff, "drop user %s@'%%'", user_no_pw); rc= mysql_query(mysql, buff); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); return OK; } @@ -661,7 +661,7 @@ elapsed= time(NULL) - start; diag("elapsed: %lu", (unsigned long)elapsed); mysql_close(mysql); - FAIL_IF((unsigned int)elapsed > 2 * timeout, "timeout ignored") + FAIL_IF((unsigned int)elapsed > 2 * timeout, "timeout ignored"); return OK; } @@ -681,7 +681,7 @@ elapsed= time(NULL) - start; diag("elapsed: %lu", (unsigned long)elapsed); mysql_close(mysql); - FAIL_IF((unsigned int)elapsed > 2 * timeout, "timeout ignored") + FAIL_IF((unsigned int)elapsed > 2 * timeout, "timeout ignored"); return OK; } @@ -706,7 +706,7 @@ } elapsed= time(NULL) - start; diag("elapsed: %lu", (unsigned long)elapsed); - FAIL_IF((unsigned int)elapsed > timeout + 1, "timeout ignored") + FAIL_IF((unsigned int)elapsed > timeout + 1, "timeout ignored"); mysql_close(mysql); mysql= mysql_init(NULL); @@ -1730,7 +1730,40 @@ return OK; } +static int test_default_auth(MYSQL *my __attribute__((unused))) +{ + MYSQL *mysql; + + if (!is_mariadb) + return SKIP; + + mysql= mysql_init(NULL); + mysql_options(mysql, MYSQL_DEFAULT_AUTH, "mysql_clear_password"); + + if (!mysql_real_connect(mysql, hostname, username, password, schema, port, socketname, CLIENT_REMEMBER_OPTIONS)) + { + diag("Connection failed. Error: %s", mysql_error(mysql)); + mysql_close(mysql); + return FAIL; + } + mysql_close(mysql); + + mysql= mysql_init(NULL); + mysql_options(mysql, MYSQL_DEFAULT_AUTH, "caching_sha2_password"); + + if (!mysql_real_connect(mysql, hostname, username, password, schema, port, socketname, CLIENT_REMEMBER_OPTIONS)) + { + diag("Connection failed. Error: %s", mysql_error(mysql)); + mysql_close(mysql); + return FAIL; + + } + mysql_close(mysql); + return OK; +} + struct my_tests_st my_tests[] = { + {"test_default_auth", test_default_auth, TEST_CONNECTION_NONE, 0, NULL, NULL}, {"test_conc443", test_conc443, TEST_CONNECTION_NONE, 0, NULL, NULL}, {"test_conc366", test_conc366, TEST_CONNECTION_DEFAULT, 0, NULL, NULL}, {"test_conc392", test_conc392, TEST_CONNECTION_DEFAULT, 0, NULL, NULL}, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/unittest/libmariadb/cursor.c new/mariadb-connector-c-3.1.9-src/unittest/libmariadb/cursor.c --- old/mariadb-connector-c-3.1.8-src/unittest/libmariadb/cursor.c 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/unittest/libmariadb/cursor.c 2020-06-18 17:16:18.000000000 +0200 @@ -1123,7 +1123,7 @@ check_stmt_rc(rc, stmt2); rc= mysql_stmt_fetch(stmt2); - FAIL_UNLESS(rc == 0, "rc != 0") + FAIL_UNLESS(rc == 0, "rc != 0"); FAIL_UNLESS(empno == 10, "empno != 10"); FAIL_UNLESS(strcmp(firstname, "CHRISTINE""") == 0, "firstname != 'Christine'"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/unittest/libmariadb/dyncol.c new/mariadb-connector-c-3.1.9-src/unittest/libmariadb/dyncol.c --- old/mariadb-connector-c-3.1.8-src/unittest/libmariadb/dyncol.c 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/unittest/libmariadb/dyncol.c 2020-06-18 17:16:18.000000000 +0200 @@ -295,6 +295,7 @@ } ma_dynstr_free(&s); mariadb_dyncol_free(&col1); + mariadb_dyncol_free(&col2); return OK; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/unittest/libmariadb/my_test.h new/mariadb-connector-c-3.1.9-src/unittest/libmariadb/my_test.h --- old/mariadb-connector-c-3.1.8-src/unittest/libmariadb/my_test.h 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/unittest/libmariadb/my_test.h 2020-06-18 17:16:18.000000000 +0200 @@ -64,57 +64,71 @@ #define MAX_TEST_QUERY_LENGTH 300 /* MAX QUERY BUFFER LENGTH */ /* prevent warnings on Win64 by using STMT_LEN instead of strlen */ -#define STMT_LEN(A) (unsigned long)strlen((A)) +#define STMT_LEN(A) ((unsigned long)strlen((A))) #define SKIP_TRAVIS()\ -if (getenv("TRAVIS"))\ -{\ - diag("Skip test on Travis CI");\ - return SKIP;\ -} +do {\ + if (getenv("TRAVIS"))\ + {\ + diag("Skip test on Travis CI");\ + return SKIP;\ + }\ +}while(0) #define SKIP_MYSQL(mysql)\ -if (!mariadb_connection(mysql))\ -{\ - diag("Skip test for non MariaDB server");\ - return OK;\ -} +do {\ + if (!mariadb_connection(mysql))\ + {\ + diag("Skip test for non MariaDB server");\ + return OK;\ + }\ +} while(0) #define check_mysql_rc(rc, mysql) \ -if (rc)\ -{\ - diag("Error (%d): %s (%d) in %s line %d", rc, mysql_error(mysql), \ - mysql_errno(mysql), __FILE__, __LINE__);\ - return(FAIL);\ -} +do {\ + if (rc)\ + {\ + diag("Error (%d): %s (%d) in %s line %d", rc, mysql_error(mysql), \ + mysql_errno(mysql), __FILE__, __LINE__);\ + return(FAIL);\ + }\ +} while(0) #define check_stmt_rc(rc, stmt) \ -if (rc)\ -{\ - diag("Error: %s (%s: %d)", mysql_stmt_error(stmt), __FILE__, __LINE__);\ - return(FAIL);\ -} +do {\ + if (rc)\ + {\ + diag("Error: %s (%s: %d)", mysql_stmt_error(stmt), __FILE__, __LINE__);\ + return(FAIL);\ + }\ +} while(0) #define FAIL_IF(expr, reason)\ -if (expr)\ -{\ - diag("Error: %s (%s: %d)", (reason) ? reason : "", __FILE__, __LINE__);\ - return FAIL;\ -} +do {\ + if (expr)\ + {\ + diag("Error: %s (%s: %d)", (reason) ? reason : "", __FILE__, __LINE__);\ + return FAIL;\ + }\ +} while(0) #define FAIL_UNLESS(expr, reason)\ -if (!(expr))\ -{\ - diag("Error: %s (%s: %d)", reason, __FILE__, __LINE__);\ - return FAIL;\ -} +do {\ + if (!(expr))\ + {\ + diag("Error: %s (%s: %d)", reason, __FILE__, __LINE__);\ + return FAIL;\ + }\ +} while(0) #define SKIP_CONNECTION_HANDLER \ - if (hostname && strstr(hostname, "://"))\ +do {\ + if (hostname && strstr(hostname, "://"))\ {\ diag("Test skipped (connection handler)");\ return SKIP;\ - } + }\ +} while(0) /* connection options */ #define TEST_CONNECTION_DEFAULT 1 /* default connection */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/unittest/libmariadb/ps.c new/mariadb-connector-c-3.1.9-src/unittest/libmariadb/ps.c --- old/mariadb-connector-c-3.1.8-src/unittest/libmariadb/ps.c 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/unittest/libmariadb/ps.c 2020-06-18 17:16:18.000000000 +0200 @@ -678,7 +678,7 @@ char query[MAX_TEST_QUERY_LENGTH]; rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_prepare_ext"); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); sql= (char *)"CREATE TABLE test_prepare_ext" "(" @@ -716,7 +716,7 @@ " c32 set('monday', 'tuesday', 'wednesday'))"; rc= mysql_query(mysql, sql); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); /* insert by prepare - all integers */ strcpy(query, "INSERT INTO test_prepare_ext(c1, c2, c3, c4, c5, c6) VALUES(?, ?, ?, ?, ?, ?)"); @@ -785,7 +785,7 @@ mysql_stmt_close(stmt); rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_prepare_ext"); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); return OK; } @@ -1203,7 +1203,7 @@ stmt= mysql_stmt_init(mysql); FAIL_IF(!stmt, mysql_error(mysql)); rc= mysql_stmt_prepare(stmt, SL(query)); - check_stmt_rc(rc, stmt) + check_stmt_rc(rc, stmt); FAIL_IF(mysql_stmt_param_count(stmt) != 3, "Paramcount != 3"); @@ -1296,7 +1296,7 @@ stmt= mysql_stmt_init(mysql); FAIL_IF(!stmt, mysql_error(mysql)); rc= mysql_stmt_prepare(stmt, SL(query)); - check_stmt_rc(rc, stmt) + check_stmt_rc(rc, stmt); FAIL_IF(mysql_stmt_param_count(stmt) != 2, "Paramcount != 2"); @@ -1395,7 +1395,7 @@ stmt= mysql_stmt_init(mysql); FAIL_IF(!stmt, mysql_error(mysql)); rc= mysql_stmt_prepare(stmt, SL(query)); - check_stmt_rc(rc, stmt) + check_stmt_rc(rc, stmt); FAIL_IF(mysql_stmt_param_count(stmt) != 2, "Paramcount != 2"); @@ -1465,7 +1465,7 @@ stmt= mysql_stmt_init(mysql); FAIL_IF(!stmt, mysql_error(mysql)); rc= mysql_stmt_prepare(stmt, SL(query)); - check_stmt_rc(rc, stmt) + check_stmt_rc(rc, stmt); FAIL_IF(mysql_stmt_param_count(stmt) != 0, "Paramcount != 0"); @@ -1560,7 +1560,7 @@ stmt= mysql_stmt_init(mysql); FAIL_IF(!stmt, mysql_error(mysql)); rc= mysql_stmt_prepare(stmt, SL(query)); - check_stmt_rc(rc, stmt) + check_stmt_rc(rc, stmt); FAIL_IF(mysql_stmt_param_count(stmt) != 2, "Paramcount != 2"); @@ -1653,7 +1653,7 @@ stmt= mysql_stmt_init(mysql); FAIL_IF(!stmt, mysql_error(mysql)); rc= mysql_stmt_prepare(stmt, SL(query)); - check_stmt_rc(rc, stmt) + check_stmt_rc(rc, stmt); FAIL_IF(mysql_stmt_param_count(stmt) != 2, "Paramcount != 2"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/unittest/libmariadb/ps_bugs.c new/mariadb-connector-c-3.1.9-src/unittest/libmariadb/ps_bugs.c --- old/mariadb-connector-c-3.1.8-src/unittest/libmariadb/ps_bugs.c 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/unittest/libmariadb/ps_bugs.c 2020-06-18 17:16:18.000000000 +0200 @@ -1064,10 +1064,10 @@ rc= mysql_query(mysql, "DROP TABLE IF EXISTS prepare_command"); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); rc= mysql_query(mysql, "CREATE TABLE prepare_command(ID INT)"); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); stmt= mysql_stmt_init(mysql); FAIL_IF(!stmt, mysql_error(mysql)); @@ -1106,9 +1106,9 @@ tm.second = 42; rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1"); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); rc= mysql_query(mysql, "CREATE TABLE t1 (f1 DATE)"); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); stmt= mysql_stmt_init(mysql); rc= mysql_stmt_prepare(stmt, SL(query)); @@ -1120,7 +1120,7 @@ rc= mysql_stmt_close(stmt); check_stmt_rc(rc, stmt); rc= mysql_query(mysql, "DROP TABLE t1"); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); FAIL_UNLESS(tm.hour == 14 && tm.minute == 9 && tm.second == 42, "time != 14:09:42"); return OK; } @@ -1142,10 +1142,10 @@ /* create table and insert few rows */ rc= mysql_query(mysql, drop); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); rc= mysql_query(mysql, create); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); stmt= mysql_stmt_init(mysql); FAIL_IF(!stmt, mysql_error(mysql)); @@ -1160,7 +1160,7 @@ FAIL_UNLESS(exp_count == 1, "exp_count != 1"); rc= mysql_query(mysql, SELECT); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); /* mysql_store_result overwrites mysql->affected_rows. Check that mysql_stmt_affected_rows() returns the same value, whereas @@ -1173,7 +1173,7 @@ FAIL_UNLESS(exp_count == mysql_stmt_affected_rows(stmt), "affected_rows != exp_count"); rc= mysql_query(mysql, update); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); FAIL_UNLESS(mysql_affected_rows(mysql) == NUM_ROWS, "affected_rows != NUM_ROWS"); FAIL_UNLESS(exp_count == mysql_stmt_affected_rows(stmt), "affected_rows != exp_count"); @@ -1192,13 +1192,13 @@ FAIL_UNLESS(exp_count == NUM_ROWS, "exp_count != NUM_ROWS"); rc= mysql_query(mysql, insert); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); FAIL_UNLESS(mysql_affected_rows(mysql) == 1, "affected_rows != 1"); FAIL_UNLESS(exp_count == mysql_stmt_affected_rows(stmt), "affected_rows != exp_count"); mysql_stmt_close(stmt); rc= mysql_query(mysql, drop); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); return OK; } @@ -1215,10 +1215,10 @@ rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_bug2248"); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); rc= mysql_query(mysql, "CREATE TABLE test_bug2248 (id int)"); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); stmt= mysql_stmt_init(mysql); FAIL_IF(!stmt, mysql_error(mysql)); @@ -1256,7 +1256,7 @@ mysql_stmt_close(stmt); rc= mysql_query(mysql, "DROP TABLE test_bug2248"); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); return OK; } @@ -2658,7 +2658,7 @@ MAX_PARAM_COUNT * CHARS_PER_PARAM + 1); param_str= (char*) malloc(COLUMN_COUNT * CHARS_PER_PARAM); - FAIL_IF(my_bind == 0 || query == 0 || param_str == 0, "Not enough memory") + FAIL_IF(my_bind == 0 || query == 0 || param_str == 0, "Not enough memory"); stmt= mysql_stmt_init(mysql); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mariadb-connector-c-3.1.8-src/unittest/libmariadb/result.c new/mariadb-connector-c-3.1.9-src/unittest/libmariadb/result.c --- old/mariadb-connector-c-3.1.8-src/unittest/libmariadb/result.c 2020-05-07 15:06:32.000000000 +0200 +++ new/mariadb-connector-c-3.1.9-src/unittest/libmariadb/result.c 2020-06-18 17:16:18.000000000 +0200 @@ -541,16 +541,16 @@ mysql_query(mysql, "set sql_mode=''"); rc= mysql_query(mysql, "drop table if exists t1"); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); rc= mysql_query(mysql, "drop view if exists v1"); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); rc= mysql_query(mysql, "create table t1(f1 int)"); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); rc= mysql_query(mysql, "create view v1 as select va.* from t1 va"); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); result= mysql_list_fields(mysql, "v1", NULL); FAIL_IF(!result, "Invalid result set"); @@ -568,8 +568,8 @@ } mysql_free_result(result); - check_mysql_rc(mysql_query(mysql, "drop view v1"), mysql) - check_mysql_rc(mysql_query(mysql, "drop table t1"), mysql) + check_mysql_rc(mysql_query(mysql, "drop view v1"), mysql); + check_mysql_rc(mysql_query(mysql, "drop table t1"), mysql); return OK; } @@ -604,17 +604,17 @@ check_mysql_rc(rc, mysql); rc= mysql_query(mysql, update_query); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); insert_id= mysql_insert_id(mysql); FAIL_UNLESS(insert_id == 2, "insert_id != 2"); rc= mysql_query(mysql, update_query); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); insert_id= mysql_insert_id(mysql); FAIL_UNLESS(insert_id == 3, "insert_id != 3"); rc= mysql_query(mysql, select_query); - check_mysql_rc(rc, mysql) + check_mysql_rc(rc, mysql); insert_id= mysql_insert_id(mysql); FAIL_UNLESS(insert_id == 3, "insert_id != 3"); result= mysql_store_result(mysql); ++++++ private_library.patch ++++++ --- /var/tmp/diff_new_pack.w8OJNf/_old 2020-07-09 17:49:06.441450839 +0200 +++ /var/tmp/diff_new_pack.w8OJNf/_new 2020-07-09 17:49:06.441450839 +0200 @@ -8,11 +8,11 @@ exports all symbols. With the exception of exported symbols, it is identical to the regular library. -Index: mariadb-connector-c-3.1.8-src/libmariadb/CMakeLists.txt +Index: mariadb-connector-c-3.1.9-src/libmariadb/CMakeLists.txt =================================================================== ---- mariadb-connector-c-3.1.8-src.orig/libmariadb/CMakeLists.txt -+++ mariadb-connector-c-3.1.8-src/libmariadb/CMakeLists.txt -@@ -411,17 +411,25 @@ IF(CMAKE_SIZEOF_VOID_P EQUAL 8 AND MSVC) +--- mariadb-connector-c-3.1.9-src.orig/libmariadb/CMakeLists.txt ++++ mariadb-connector-c-3.1.9-src/libmariadb/CMakeLists.txt +@@ -411,6 +411,12 @@ IF(CMAKE_SIZEOF_VOID_P EQUAL 8 AND MSVC) SET_TARGET_PROPERTIES(mariadbclient PROPERTIES STATIC_LIBRARY_FLAGS "/machine:x64") ENDIF() @@ -23,8 +23,9 @@ +ENDIF() + IF(CMAKE_SYSTEM_NAME MATCHES "Linux" OR + CMAKE_SYSTEM_NAME MATCHES "kFreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "GNU") - IF (NOT WITH_ASAN AND NOT WITH_TSAN AND NOT WITH_UBSAN AND NOT WITH_MSAN) +@@ -418,11 +424,13 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux" OR TARGET_LINK_LIBRARIES (libmariadb LINK_PRIVATE "-Wl,--no-undefined") ENDIF() SET_TARGET_PROPERTIES(libmariadb PROPERTIES LINK_FLAGS "${CC_BINARY_DIR}/libmariadb/mariadbclient.def") @@ -38,7 +39,7 @@ SET_TARGET_PROPERTIES(libmariadb PROPERTIES PREFIX "") # -@@ -455,7 +463,9 @@ INSTALL(TARGETS mariadbclient +@@ -456,7 +464,9 @@ INSTALL(TARGETS mariadbclient INSTALL(TARGETS libmariadb COMPONENT SharedLibraries DESTINATION ${INSTALL_LIBDIR}) @@ -49,10 +50,10 @@ IF(MSVC) # On Windows, install PDB -Index: mariadb-connector-c-3.1.8-src/mariadb_config/mariadb_config.c.in +Index: mariadb-connector-c-3.1.9-src/mariadb_config/mariadb_config.c.in =================================================================== ---- mariadb-connector-c-3.1.8-src.orig/mariadb_config/mariadb_config.c.in -+++ mariadb-connector-c-3.1.8-src/mariadb_config/mariadb_config.c.in +--- mariadb-connector-c-3.1.9-src.orig/mariadb_config/mariadb_config.c.in ++++ mariadb-connector-c-3.1.9-src/mariadb_config/mariadb_config.c.in @@ -7,6 +7,8 @@ static char *mariadb_progname; #define INCLUDE "-I@INSTALL_INCLUDEDIR@ -I@INSTALL_INCLUDEDIR@/mariadb"