summaryrefslogtreecommitdiffstats
path: root/libmariadb
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 13:22:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 13:22:53 +0000
commit347c164c35eddab388009470e6848cb361ac93f8 (patch)
tree2c0c44eac690f510bb0a35b2a13b36d606b77b6b /libmariadb
parentReleasing progress-linux version 1:10.11.7-4~progress7.99u1. (diff)
downloadmariadb-347c164c35eddab388009470e6848cb361ac93f8.tar.xz
mariadb-347c164c35eddab388009470e6848cb361ac93f8.zip
Merging upstream version 1:10.11.8.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libmariadb')
-rw-r--r--libmariadb/.gitattributes9
-rw-r--r--libmariadb/.gitignore116
-rw-r--r--libmariadb/CMakeLists.txt4
-rw-r--r--libmariadb/include/CMakeLists.txt1
-rw-r--r--libmariadb/include/errmsg.h3
-rw-r--r--libmariadb/include/ma_hash.h22
-rw-r--r--libmariadb/include/mariadb_com.h8
-rw-r--r--libmariadb/include/mysql/client_plugin.h2
-rw-r--r--libmariadb/include/mysql/plugin_auth_common.h110
-rw-r--r--libmariadb/libmariadb/ma_default.c1
-rw-r--r--libmariadb/libmariadb/ma_errmsg.c3
-rw-r--r--libmariadb/libmariadb/mariadb_async.c2
-rw-r--r--libmariadb/libmariadb/mariadb_lib.c17
-rw-r--r--libmariadb/libmariadb/secure/openssl.c2
-rw-r--r--libmariadb/plugins/io/remote_io.c4
-rw-r--r--libmariadb/plugins/pvio/pvio_socket.c2
-rw-r--r--libmariadb/plugins/trace/trace_example.c2
-rw-r--r--libmariadb/unittest/libmariadb/bulk1.c4
-rw-r--r--libmariadb/unittest/libmariadb/connection.c26
-rw-r--r--libmariadb/unittest/libmariadb/ps_bugs.c4
20 files changed, 213 insertions, 129 deletions
diff --git a/libmariadb/.gitattributes b/libmariadb/.gitattributes
new file mode 100644
index 00000000..09f80895
--- /dev/null
+++ b/libmariadb/.gitattributes
@@ -0,0 +1,9 @@
+# Normalise line endings:
+* text=auto
+
+# Prevent certain files from being exported:
+.gitattributes export-ignore
+.gitignore export-ignore
+
+# merge
+.travis.yml merge=cc
diff --git a/libmariadb/.gitignore b/libmariadb/.gitignore
new file mode 100644
index 00000000..bc8fa2af
--- /dev/null
+++ b/libmariadb/.gitignore
@@ -0,0 +1,116 @@
+CMakeCache.txt
+CMakeFiles/*
+Makefile
+include/my_config.h
+include/mysql_version.h
+CMakeFiles
+mysql_config/mysql_config.c
+examples/mysql_affected_rows
+examples/mysql_debug
+examples/test_output
+mysql_config/mysql_config
+mariadb_config/libmariadb.pc
+
+# Keep empty directories:
+# Keep empty directories: >> .gitignore/.git*
+
+# Compiled Static libraries
+*.lib
+*.a
+*.la
+*.lai
+*.lo
+
+# Compiled Dynamic libraries
+*.so
+*.so.*
+*.dylib
+*.dll
+
+# Executables
+*.exe
+*.out
+*.app
+*.i*86
+*.x86_64
+*.hex
+
+*.dgcov
+.*.swp
+.gdb_history
+CTestTestfile.cmake
+cmake_install.cmake
+bin/
+include/config.h
+include/ma_config.h
+include/mariadb/mariadb/
+include/mariadb/ma_errmsg.h
+include/mariadb/ma_list.h
+include/mariadb/ma_pvio.h
+include/mariadb/ma_tls.h
+include/mariadb/mariadb_com.h
+include/mariadb/mariadb_ctype.h
+include/mariadb/mariadb_dyncol.h
+include/mariadb/mariadb_stmt.h
+include/mariadb/mariadb_version.h
+include/mariadb/mysql.h
+include/mariadb/mysql/
+include/mariadb_version.h
+lib/
+libmariadb/home/
+libmariadb/ma_client_plugin.c
+libmariadb/mariadbclient.def
+mariadb_config/mariadb_config
+mariadb_config/mariadb_config.c
+manpages.list
+unittest/libmariadb/async
+unittest/libmariadb/basic-t
+unittest/libmariadb/bulk1
+unittest/libmariadb/charset
+unittest/libmariadb/connection
+unittest/libmariadb/cursor
+unittest/libmariadb/dyncol
+unittest/libmariadb/errors
+unittest/libmariadb/features-10_2
+unittest/libmariadb/fetch
+unittest/libmariadb/fingerprint.list
+unittest/libmariadb/logs
+unittest/libmariadb/misc
+unittest/libmariadb/performance
+unittest/libmariadb/ps
+unittest/libmariadb/ps_bugs
+unittest/libmariadb/ps_new
+unittest/libmariadb/result
+unittest/libmariadb/rpl_api
+unittest/libmariadb/sp
+unittest/libmariadb/sqlite3
+unittest/libmariadb/ssl
+unittest/libmariadb/t_aurora
+unittest/libmariadb/t_conc173
+unittest/libmariadb/thread
+unittest/libmariadb/view
+unittest/libmariadb/conc336
+
+benchmark/benchmark/
+benchmark/bld/
+benchmark/mariadb.json
+benchmark/mysql.json
+benchmark/main-benchmark
+
+#VS files/directories
+*.vcxproj
+*.filters
+*.user
+ipch
+*.sln
+*.suo
+*.sdf
+Win32
+x64
+*.dir
+Debug
+Release
+RelWithDebInfo
+
+#vim backups
+*.*~
diff --git a/libmariadb/CMakeLists.txt b/libmariadb/CMakeLists.txt
index 4aab676d..b987bc7f 100644
--- a/libmariadb/CMakeLists.txt
+++ b/libmariadb/CMakeLists.txt
@@ -36,7 +36,7 @@ SET(CC_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
SET(CPACK_PACKAGE_VERSION_MAJOR 3)
SET(CPACK_PACKAGE_VERSION_MINOR 3)
-SET(CPACK_PACKAGE_VERSION_PATCH 9)
+SET(CPACK_PACKAGE_VERSION_PATCH 10)
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 +
@@ -395,7 +395,7 @@ ENDIF()
MESSAGE1(SYSTEM_LIBS "SYSTEM_LIBS ${SYSTEM_LIBS}")
MARK_AS_ADVANCED(SYSTEM_LIBS)
-IF(NOT IS_SUBPROJECT)
+IF(NOT IS_SUBPROJECT AND (NOT DEFINED CMAKE_COMPILE_WARNING_AS_ERROR))
IF ((NOT WIN32) AND (CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID MATCHES "GNU"))
SET(WARNING_AS_ERROR "-Werror")
ELSEIF(CMAKE_C_COMPILER_ID MATCHES "MSVC")
diff --git a/libmariadb/include/CMakeLists.txt b/libmariadb/include/CMakeLists.txt
index b9eed535..137cbe94 100644
--- a/libmariadb/include/CMakeLists.txt
+++ b/libmariadb/include/CMakeLists.txt
@@ -17,7 +17,6 @@ IF(NOT IS_SUBPROJECT)
ENDIF()
SET(MYSQL_ADDITIONAL_INCLUDES
${CC_SOURCE_DIR}/include/mysql/client_plugin.h
- ${CC_SOURCE_DIR}/include/mysql/plugin_auth_common.h
${CC_SOURCE_DIR}/include/mysql/plugin_auth.h
)
SET(MARIADB_ADDITIONAL_INCLUDES
diff --git a/libmariadb/include/errmsg.h b/libmariadb/include/errmsg.h
index 4afe8e8a..f22db164 100644
--- a/libmariadb/include/errmsg.h
+++ b/libmariadb/include/errmsg.h
@@ -114,10 +114,11 @@ extern const char *mariadb_client_errors[]; /* Error messages */
#define CR_BINLOG_ERROR 5021
#define CR_BINLOG_INVALID_FILE 5022
#define CR_BINLOG_SEMI_SYNC_ERROR 5023
+#define CR_INVALID_CLIENT_FLAG 5024
/* Always last, if you add new error codes please update the
value for CR_MARIADB_LAST_ERROR */
-#define CR_MARIADB_LAST_ERROR CR_BINLOG_INVALID_FILE
+#define CR_MARIADB_LAST_ERROR CR_INVALID_CLIENT_FLAG
#endif
diff --git a/libmariadb/include/ma_hash.h b/libmariadb/include/ma_hash.h
new file mode 100644
index 00000000..1a40d48a
--- /dev/null
+++ b/libmariadb/include/ma_hash.h
@@ -0,0 +1,22 @@
+#ifndef _ma_hash_h_
+#define _ma_hash_h_
+
+/*! Hash algorithms */
+#define MA_HASH_MD5 1
+#define MA_HASH_SHA1 2
+#define MA_HASH_SHA224 3
+#define MA_HASH_SHA256 4
+#define MA_HASH_SHA384 5
+#define MA_HASH_SHA512 6
+
+/*! Hash digest sizes */
+#define MA_MD5_HASH_SIZE 16
+#define MA_SHA1_HASH_SIZE 20
+#define MA_SHA224_HASH_SIZE 28
+#define MA_SHA256_HASH_SIZE 32
+#define MA_SHA384_HASH_SIZE 48
+#define MA_SHA512_HASH_SIZE 64
+
+#define MA_MAX_HASH_SIZE 64
+
+#endif
diff --git a/libmariadb/include/mariadb_com.h b/libmariadb/include/mariadb_com.h
index 67461b4f..01a13dab 100644
--- a/libmariadb/include/mariadb_com.h
+++ b/libmariadb/include/mariadb_com.h
@@ -205,11 +205,17 @@ 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_SESSION_TRACKING |\
CLIENT_CONNECT_ATTRS)
+#define CLIENT_ALLOWED_FLAGS (CLIENT_SUPPORTED_FLAGS |\
+ CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA |\
+ CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS |\
+ CLIENT_ZSTD_COMPRESSION |\
+ CLIENT_PS_MULTI_RESULTS |\
+ CLIENT_REMEMBER_OPTIONS)
#define CLIENT_CAPABILITIES (CLIENT_MYSQL | \
CLIENT_LONG_FLAG |\
CLIENT_TRANSACTIONS |\
diff --git a/libmariadb/include/mysql/client_plugin.h b/libmariadb/include/mysql/client_plugin.h
index 262fd4a0..667074ce 100644
--- a/libmariadb/include/mysql/client_plugin.h
+++ b/libmariadb/include/mysql/client_plugin.h
@@ -122,7 +122,7 @@ typedef struct st_mariadb_client_plugin_PVIO
} MARIADB_PVIO_PLUGIN;
/******** authentication plugin specific declarations *********/
-#include <mysql/plugin_auth_common.h>
+#include <mysql/plugin_auth.h>
struct st_mysql_client_plugin_AUTHENTICATION
{
diff --git a/libmariadb/include/mysql/plugin_auth_common.h b/libmariadb/include/mysql/plugin_auth_common.h
deleted file mode 100644
index ee4b8b9c..00000000
--- a/libmariadb/include/mysql/plugin_auth_common.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/* 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., 51 Franklin Street, Fifth Floor, Boston,
- MA 02111-1301, USA */
-
-
-#ifndef MYSQL_PLUGIN_AUTH_COMMON_INCLUDED
-/**
- @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/libmariadb/libmariadb/ma_default.c b/libmariadb/libmariadb/ma_default.c
index 0f6921c1..80efe1c9 100644
--- a/libmariadb/libmariadb/ma_default.c
+++ b/libmariadb/libmariadb/ma_default.c
@@ -135,6 +135,7 @@ char **get_default_configuration_dirs()
end:
return configuration_dirs;
error:
+ release_configuration_dirs();
return NULL;
}
diff --git a/libmariadb/libmariadb/ma_errmsg.c b/libmariadb/libmariadb/ma_errmsg.c
index 888a41e3..90218573 100644
--- a/libmariadb/libmariadb/ma_errmsg.c
+++ b/libmariadb/libmariadb/ma_errmsg.c
@@ -53,7 +53,7 @@ const char *client_errors[]=
/* 2023 */ "",
/* 2024 */ "",
/* 2025 */ "",
-/* 2026 */ "TLS/SSL error: %-.100s",
+/* 2026 */ "TLS/SSL error: %s",
/* 2027 */ "Received malformed packet",
/* 2028 */ "",
/* 2029 */ "",
@@ -118,6 +118,7 @@ const char *mariadb_client_errors[] =
/* 5021 */ "Binary log error (File: %.*s start_pos=%ld): %s.",
/* 5022 */ "File '%s' is not a binary log file",
/* 5023 */ "Semi sync request error: %s",
+ /* 5024 */ "Invalid client flags (%lu) specified. Supported flags: %lu",
""
};
diff --git a/libmariadb/libmariadb/mariadb_async.c b/libmariadb/libmariadb/mariadb_async.c
index feb73329..5068f5c0 100644
--- a/libmariadb/libmariadb/mariadb_async.c
+++ b/libmariadb/libmariadb/mariadb_async.c
@@ -140,7 +140,7 @@ my_ssl_async_check_result(int res, struct mysql_async_context *b, MARIADB_SSL *c
{
int ssl_err;
b->events_to_wait_for= 0;
- if (res >= 0)
+ if (res > 0)
return 1;
ssl_err= SSL_get_error(ssl, res);
if (ssl_err == SSL_ERROR_WANT_READ)
diff --git a/libmariadb/libmariadb/mariadb_lib.c b/libmariadb/libmariadb/mariadb_lib.c
index 36219385..c48ccdad 100644
--- a/libmariadb/libmariadb/mariadb_lib.c
+++ b/libmariadb/libmariadb/mariadb_lib.c
@@ -710,6 +710,7 @@ struct st_default_options mariadb_defaults[] =
{{MARIADB_OPT_TLS_PASSPHRASE}, MARIADB_OPTION_STR, "tls-passphrase"},
{{MYSQL_OPT_SSL_ENFORCE}, MARIADB_OPTION_BOOL, "tls-enforce"},
{{MYSQL_OPT_SSL_VERIFY_SERVER_CERT}, MARIADB_OPTION_BOOL,"tls-verify-peer"},
+ {{MARIADB_OPT_RESTRICTED_AUTH}, MARIADB_OPTION_STR, "restricted-auth"},
{{0}, 0, NULL}
};
@@ -1433,6 +1434,14 @@ mysql_real_connect(MYSQL *mysql, const char *host, const char *user,
char *connection_handler= (mysql->options.extension) ?
mysql->options.extension->connection_handler : 0;
+ if ((client_flag & CLIENT_ALLOWED_FLAGS) != client_flag)
+ {
+ my_set_error(mysql, CR_INVALID_CLIENT_FLAG, SQLSTATE_UNKNOWN,
+ ER(CR_INVALID_CLIENT_FLAG),
+ client_flag, CLIENT_ALLOWED_FLAGS);
+ return NULL;
+ }
+
if (!mysql->methods)
mysql->methods= &MARIADB_DEFAULT_METHODS;
@@ -1808,10 +1817,14 @@ restart:
else if (IS_MYSQL_ERROR(code) || IS_MARIADB_ERROR(code))
; /* not forged - generated on the client side */
else if (mysql->options.use_ssl)
+ {
+ char last_error[sizeof(mysql->net.last_error)];
+ strcpy(last_error, mysql->net.last_error);
my_set_error(mysql, CR_CONNECTION_ERROR, SQLSTATE_UNKNOWN,
"Received error packet before completion of TLS handshake. "
- "The authenticity of the following error cannot be verified:\n%d - %s",
- code, mysql->net.last_error);
+ "The authenticity of the following error cannot be verified: %d - %s",
+ code, last_error);
+ }
goto error;
}
diff --git a/libmariadb/libmariadb/secure/openssl.c b/libmariadb/libmariadb/secure/openssl.c
index 2a272504..edc90a3b 100644
--- a/libmariadb/libmariadb/secure/openssl.c
+++ b/libmariadb/libmariadb/secure/openssl.c
@@ -533,7 +533,7 @@ ma_tls_async_check_result(int res, struct mysql_async_context *b, SSL *ssl)
{
int ssl_err;
b->events_to_wait_for= 0;
- if (res >= 0)
+ if (res > 0)
return 1;
ssl_err= SSL_get_error(ssl, res);
if (ssl_err == SSL_ERROR_WANT_READ)
diff --git a/libmariadb/plugins/io/remote_io.c b/libmariadb/plugins/io/remote_io.c
index c06ecacd..eb5b5f37 100644
--- a/libmariadb/plugins/io/remote_io.c
+++ b/libmariadb/plugins/io/remote_io.c
@@ -279,11 +279,11 @@ MA_FILE *ma_rio_open(const char *url,const char *operation)
MA_REMOTE_FILE *rf;
(void)operation;
- if (!(file = (MA_FILE *)calloc(sizeof(MA_FILE), 1)))
+ if (!(file = (MA_FILE *)calloc(1, sizeof(MA_FILE))))
return NULL;
file->type= MA_FILE_REMOTE;
- if (!(file->ptr= rf= (MA_REMOTE_FILE *)calloc(sizeof(MA_REMOTE_FILE), 1)))
+ if (!(file->ptr= rf= (MA_REMOTE_FILE *)calloc(1, sizeof(MA_REMOTE_FILE))))
{
free(file);
return NULL;
diff --git a/libmariadb/plugins/pvio/pvio_socket.c b/libmariadb/plugins/pvio/pvio_socket.c
index 550fb831..b9c70940 100644
--- a/libmariadb/plugins/pvio/pvio_socket.c
+++ b/libmariadb/plugins/pvio/pvio_socket.c
@@ -39,7 +39,7 @@
#include <sys/un.h>
#endif
#ifdef HAVE_POLL
-#include <sys/poll.h>
+#include <poll.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
diff --git a/libmariadb/plugins/trace/trace_example.c b/libmariadb/plugins/trace/trace_example.c
index 1060542c..e177c206 100644
--- a/libmariadb/plugins/trace/trace_example.c
+++ b/libmariadb/plugins/trace/trace_example.c
@@ -132,7 +132,7 @@ static TRACE_INFO *get_trace_info(unsigned long thread_id)
info= (TRACE_INFO *)info->next;
}
- if (!(info= (TRACE_INFO *)calloc(sizeof(TRACE_INFO), 1)))
+ if (!(info= (TRACE_INFO *)calloc(1, sizeof(TRACE_INFO))))
return NULL;
info->thread_id= thread_id;
info->next= trace_info;
diff --git a/libmariadb/unittest/libmariadb/bulk1.c b/libmariadb/unittest/libmariadb/bulk1.c
index e1c31eaa..62267cd7 100644
--- a/libmariadb/unittest/libmariadb/bulk1.c
+++ b/libmariadb/unittest/libmariadb/bulk1.c
@@ -74,8 +74,8 @@ static int bulk1(MYSQL *mysql)
/* allocate memory */
buffer= calloc(TEST_ARRAY_SIZE, sizeof(char *));
- lengths= (unsigned long *)calloc(sizeof(long), TEST_ARRAY_SIZE);
- vals= (unsigned int *)calloc(sizeof(int), TEST_ARRAY_SIZE);
+ lengths= calloc(TEST_ARRAY_SIZE, sizeof *lengths);
+ vals= calloc(TEST_ARRAY_SIZE, sizeof *vals);
for (i=0; i < TEST_ARRAY_SIZE; i++)
{
diff --git a/libmariadb/unittest/libmariadb/connection.c b/libmariadb/unittest/libmariadb/connection.c
index fa232cad..a10e01bd 100644
--- a/libmariadb/unittest/libmariadb/connection.c
+++ b/libmariadb/unittest/libmariadb/connection.c
@@ -2307,7 +2307,33 @@ static int test_conc632(MYSQL *my __attribute__((unused)))
return OK;
}
+static int test_conc505(MYSQL *my __attribute__((unused)))
+{
+ MYSQL *mysql= mysql_init(NULL);
+
+#define CLIENT_DEPRECATE_EOF (1ULL << 24)
+
+ if (my_test_connect(mysql, hostname, username, password, schema, port, socketname, CLIENT_DEPRECATE_EOF))
+ {
+ diag("Error expected: Invalid client flag");
+ mysql_close(mysql);
+ return FAIL;
+ }
+ diag("Error (expected): %s", mysql_error(mysql));
+ FAIL_IF(mysql_errno(mysql) != CR_INVALID_CLIENT_FLAG, "Wrong error number");
+ if (!my_test_connect(mysql, hostname, username, password, schema, port, socketname, CLIENT_MULTI_STATEMENTS | CLIENT_MULTI_RESULTS))
+ {
+ diag("Error: %s", mysql_error(mysql));
+ mysql_close(mysql);
+ return FAIL;
+ }
+
+ mysql_close(mysql);
+ return OK;
+}
+
struct my_tests_st my_tests[] = {
+ {"test_conc505", test_conc505, TEST_CONNECTION_NONE, 0, NULL, NULL},
{"test_conc632", test_conc632, TEST_CONNECTION_NONE, 0, NULL, NULL},
{"test_status_callback", test_status_callback, TEST_CONNECTION_NONE, 0, NULL, NULL},
{"test_conc365", test_conc365, TEST_CONNECTION_NONE, 0, NULL, NULL},
diff --git a/libmariadb/unittest/libmariadb/ps_bugs.c b/libmariadb/unittest/libmariadb/ps_bugs.c
index efe3d447..72af30b4 100644
--- a/libmariadb/unittest/libmariadb/ps_bugs.c
+++ b/libmariadb/unittest/libmariadb/ps_bugs.c
@@ -3257,7 +3257,7 @@ error:
static int test_mem_overun(MYSQL *mysql)
{
- char buffer[10000], field[12];
+ char buffer[10000], field[20];
MYSQL_STMT *stmt;
MYSQL_RES *field_res, *res;
int rc, i, length;
@@ -5159,7 +5159,7 @@ static int test_maxparam(MYSQL *mysql)
MYSQL_STMT *stmt= mysql_stmt_init(mysql);
MYSQL_BIND* bind;
- bind = calloc(sizeof(MYSQL_BIND), 65535);
+ bind = calloc(65535, sizeof *bind);
rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1");
check_mysql_rc(rc, mysql);