Skip to content

Commit

Permalink
MySQL: Update bundled Windows library to 8.4.0
Browse files Browse the repository at this point in the history
Compatible with OpenSSL 3.x
  • Loading branch information
Warlockbugs committed Jul 15, 2024
1 parent 3565205 commit 35339e3
Show file tree
Hide file tree
Showing 26 changed files with 6,864 additions and 5,837 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ if(WIN32)
endif()

# Define install rules for provided libs
set(BIN_LIBS ${DEV_PROVIDED_LIBS_FOLDER}/libmySQL.dll)
set(BIN_LIBS ${DEV_PROVIDED_LIBS_FOLDER}/libmysql.dll)
if(PLATFORM MATCHES X86)
if(MSVC)
# Only MSVC. TODO:: check why x64 is not provided
Expand Down Expand Up @@ -236,8 +236,8 @@ endif()
# Win32 delivered packages
if(WIN32 AND (BUILD_GAME_SERVER OR BUILD_LOGIN_SERVER OR BUILD_EXTRACTORS))
set(MYSQL_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/dep/lib/include/mysql")
set(MYSQL_LIBRARY "${CMAKE_SOURCE_DIR}/dep/lib/${DEP_ARCH}_release/libmySQL.lib")
set(MYSQL_DEBUG_LIBRARY "${CMAKE_SOURCE_DIR}/dep/lib/${DEP_ARCH}_debug/libmySQL.lib")
set(MYSQL_LIBRARY "${CMAKE_SOURCE_DIR}/dep/lib/${DEP_ARCH}_release/libmysql.lib")
set(MYSQL_DEBUG_LIBRARY "${CMAKE_SOURCE_DIR}/dep/lib/${DEP_ARCH}_debug/libmysql.lib")
set(OPENSSL_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/dep/lib/include")
set(OPENSSL_LIBRARIES
"${CMAKE_SOURCE_DIR}/dep/lib/${DEP_ARCH}_release/libcrypto.lib"
Expand Down
22 changes: 14 additions & 8 deletions dep/lib/include/mysql/errmsg.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
#ifndef ERRMSG_INCLUDED
#define ERRMSG_INCLUDED

/* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2000, 2024, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is also distributed with certain software (including
This program is designed to work with certain software (including
but not limited to OpenSSL) that is licensed under separate terms,
as designated in a particular file or component or in included license
documentation. The authors of MySQL hereby grant you an additional
permission to link the program and your derivative works with the
separately licensed software that they have included with MySQL.
separately licensed software that they have either included with
the program or referenced in the documentation.
Without limiting anything contained in the foregoing, this file,
which is part of C Driver for MySQL (Connector/C), is also subject to the
Expand Down Expand Up @@ -77,10 +78,10 @@ extern const char *client_errors[]; /* Error messages */
#define CR_CANT_READ_CHARSET 2019
#define CR_NET_PACKET_TOO_LARGE 2020
#define CR_EMBEDDED_CONNECTION 2021
#define CR_PROBE_SLAVE_STATUS 2022
#define CR_PROBE_SLAVE_HOSTS 2023
#define CR_PROBE_SLAVE_CONNECT 2024
#define CR_PROBE_MASTER_CONNECT 2025
#define CR_PROBE_REPLICA_STATUS 2022
#define CR_PROBE_REPLICA_HOSTS 2023
#define CR_PROBE_REPLICA_CONNECT 2024
#define CR_PROBE_SOURCE_CONNECT 2025
#define CR_SSL_CONNECTION_ERROR 2026
#define CR_MALFORMED_PACKET 2027
#define CR_WRONG_LICENSE 2028
Expand Down Expand Up @@ -129,7 +130,12 @@ extern const char *client_errors[]; /* Error messages */
#define CR_LOAD_DATA_LOCAL_INFILE_REJECTED 2068
#define CR_LOAD_DATA_LOCAL_INFILE_REALPATH_FAIL 2069
#define CR_DNS_SRV_LOOKUP_FAILED 2070
#define CR_ERROR_LAST /*Copy last error nr:*/ 2070
#define CR_MANDATORY_TRACKER_NOT_FOUND 2071
#define CR_INVALID_FACTOR_NO 2072
#define CR_CANT_GET_SESSION_DATA 2073
#define CR_INVALID_CLIENT_CHARSET 2074
#define CR_TLS_SERVER_NOT_FOUND 2075
#define CR_ERROR_LAST /*Copy last error nr:*/ 2075
/* Add error numbers before CR_ERROR_LAST and change it accordingly. */

/* Visual Studio requires '__inline' for C code */
Expand Down
20 changes: 10 additions & 10 deletions dep/lib/include/mysql/field_types.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
/* Copyright (c) 2014, 2020, Oracle and/or its affiliates.
/* Copyright (c) 2014, 2024, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is also distributed with certain software (including
This program is designed to work with certain software (including
but not limited to OpenSSL) that is licensed under separate terms,
as designated in a particular file or component or in included license
documentation. The authors of MySQL hereby grant you an additional
permission to link the program and your derivative works with the
separately licensed software that they have included with MySQL.
separately licensed software that they have either included with
the program or referenced in the documentation.
Without limiting anything contained in the foregoing, this file,
which is part of C Driver for MySQL (Connector/C), is also subject to the
Expand Down Expand Up @@ -48,13 +49,11 @@ extern "C" {

/**
Column types for MySQL
Note: Keep include/mysql/components/services/bits/stored_program_bits.h in
sync with this
*/
enum enum_field_types
#if defined(__cplusplus) && __cplusplus > 201103L
// N2764: Forward enum declarations, added in C++11
: int
#endif /* __cplusplus */
{ MYSQL_TYPE_DECIMAL,
enum enum_field_types {
MYSQL_TYPE_DECIMAL,
MYSQL_TYPE_TINY,
MYSQL_TYPE_SHORT,
MYSQL_TYPE_LONG,
Expand Down Expand Up @@ -87,7 +86,8 @@ enum enum_field_types
MYSQL_TYPE_BLOB = 252,
MYSQL_TYPE_VAR_STRING = 253,
MYSQL_TYPE_STRING = 254,
MYSQL_TYPE_GEOMETRY = 255 };
MYSQL_TYPE_GEOMETRY = 255
};

#ifdef __cplusplus
} // extern "C"
Expand Down
26 changes: 14 additions & 12 deletions dep/lib/include/mysql/my_command.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
/* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2015, 2024, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is also distributed with certain software (including
This program is designed to work with certain software (including
but not limited to OpenSSL) that is licensed under separate terms,
as designated in a particular file or component or in included license
documentation. The authors of MySQL hereby grant you an additional
permission to link the program and your derivative works with the
separately licensed software that they have included with MySQL.
separately licensed software that they have either included with
the program or referenced in the documentation.
Without limiting anything contained in the foregoing, this file,
which is part of C Driver for MySQL (Connector/C), is also subject to the
Expand Down Expand Up @@ -56,15 +57,15 @@ enum enum_server_command {
COM_FIELD_LIST, /**< Deprecated. See @ref page_protocol_com_field_list */
COM_CREATE_DB, /**< Currently refused by the server. See ::dispatch_command */
COM_DROP_DB, /**< Currently refused by the server. See ::dispatch_command */
COM_REFRESH, /**< Deprecated. See @ref page_protocol_com_refresh */
COM_DEPRECATED_1, /**< Deprecated, used to be COM_SHUTDOWN */
COM_STATISTICS, /**< See @ref page_protocol_com_statistics */
COM_PROCESS_INFO, /**< Deprecated. See @ref page_protocol_com_process_info */
COM_CONNECT, /**< Currently refused by the server. */
COM_PROCESS_KILL, /**< Deprecated. See @ref page_protocol_com_process_kill */
COM_DEBUG, /**< See @ref page_protocol_com_debug */
COM_PING, /**< See @ref page_protocol_com_ping */
COM_TIME, /**< Currently refused by the server. */
COM_UNUSED_2, /**< Removed, used to be COM_REFRESH. */
COM_UNUSED_1, /**< Removed, used to be COM_SHUTDOWN */
COM_STATISTICS, /**< See @ref page_protocol_com_statistics */
COM_UNUSED_4, /**< Removed, used to be COM_PROCESS_INFO */
COM_CONNECT, /**< Currently refused by the server. */
COM_UNUSED_5, /**< Removed, used to be COM_PROCESS_KILL */
COM_DEBUG, /**< See @ref page_protocol_com_debug */
COM_PING, /**< See @ref page_protocol_com_ping */
COM_TIME, /**< Currently refused by the server. */
COM_DELAYED_INSERT, /**< Functionality removed. */
COM_CHANGE_USER, /**< See @ref page_protocol_com_change_user */
COM_BINLOG_DUMP, /**< See @ref page_protocol_com_binlog_dump */
Expand Down Expand Up @@ -93,6 +94,7 @@ enum enum_server_command {
COM_BINLOG_DUMP_GTID,
COM_RESET_CONNECTION, /**< See @ref page_protocol_com_reset_connection */
COM_CLONE,
COM_SUBSCRIBE_GROUP_REPLICATION_STREAM,
/* don't forget to update const char *command_name[] in sql_parse.cc */

/* Must be last */
Expand Down
7 changes: 4 additions & 3 deletions dep/lib/include/mysql/my_compress.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
/* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2019, 2024, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is also distributed with certain software (including
This program is designed to work with certain software (including
but not limited to OpenSSL) that is licensed under separate terms,
as designated in a particular file or component or in included license
documentation. The authors of MySQL hereby grant you an additional
permission to link the program and your derivative works with the
separately licensed software that they have included with MySQL.
separately licensed software that they have either included with
the program or referenced in the documentation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
Expand Down
18 changes: 7 additions & 11 deletions dep/lib/include/mysql/my_list.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
/* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2000, 2024, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is also distributed with certain software (including
This program is designed to work with certain software (including
but not limited to OpenSSL) that is licensed under separate terms,
as designated in a particular file or component or in included license
documentation. The authors of MySQL hereby grant you an additional
permission to link the program and your derivative works with the
separately licensed software that they have included with MySQL.
separately licensed software that they have either included with
the program or referenced in the documentation.
Without limiting anything contained in the foregoing, this file,
which is part of C Driver for MySQL (Connector/C), is also subject to the
Expand All @@ -25,21 +26,16 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */

#ifndef _list_h_
#define _list_h_
#ifndef MY_LIST_INCLUDED
#define MY_LIST_INCLUDED

/**
@file include/my_list.h
*/

typedef struct LIST {
#if defined(__cplusplus) && __cplusplus >= 201103L
struct LIST *prev{nullptr}, *next{nullptr};
void *data{nullptr};
#else
struct LIST *prev, *next;
void *data;
#endif
} LIST;

typedef int (*list_walk_action)(void *, void *);
Expand All @@ -54,4 +50,4 @@ extern int list_walk(LIST *, list_walk_action action, unsigned char *argument);

#define list_rest(a) ((a)->next)

#endif
#endif // MY_LIST_INCLUDED
51 changes: 40 additions & 11 deletions dep/lib/include/mysql/mysql.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
/* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2000, 2024, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is also distributed with certain software (including
This program is designed to work with certain software (including
but not limited to OpenSSL) that is licensed under separate terms,
as designated in a particular file or component or in included license
documentation. The authors of MySQL hereby grant you an additional
permission to link the program and your derivative works with the
separately licensed software that they have included with MySQL.
separately licensed software that they have either included with
the program or referenced in the documentation.
Without limiting anything contained in the foregoing, this file,
which is part of C Driver for MySQL (Connector/C), is also subject to the
Expand Down Expand Up @@ -54,21 +55,21 @@ typedef uint64_t my_ulonglong;

#ifndef my_socket_defined
#define my_socket_defined
#ifdef _WIN32
#if defined(_WIN32) && !defined(MYSQL_ABI_CHECK)
#include <windows.h>
#ifdef WIN32_LEAN_AND_MEAN
#include <winsock2.h>
#endif
#define my_socket SOCKET
#else
typedef int my_socket;
#endif /* _WIN32 */
#endif /* _WIN32 && ! MYSQL_ABI_CHECK */
#endif /* my_socket_defined */

// Small extra definition to avoid pulling in my_compiler.h in client code.
// IWYU pragma: no_include "my_compiler.h"
#ifndef MY_COMPILER_INCLUDED
#if !defined(_WIN32)
#if !defined(_WIN32) || defined(MYSQL_ABI_CHECK)
#define STDCALL
#else
#define STDCALL __stdcall
Expand Down Expand Up @@ -210,7 +211,10 @@ enum mysql_option {
MYSQL_OPT_TLS_CIPHERSUITES,
MYSQL_OPT_COMPRESSION_ALGORITHMS,
MYSQL_OPT_ZSTD_COMPRESSION_LEVEL,
MYSQL_OPT_LOAD_DATA_LOCAL_DIR
MYSQL_OPT_LOAD_DATA_LOCAL_DIR,
MYSQL_OPT_USER_PASSWORD,
MYSQL_OPT_SSL_SESSION_DATA,
MYSQL_OPT_TLS_SNI_SERVERNAME
};

/**
Expand Down Expand Up @@ -282,8 +286,8 @@ enum mysql_ssl_fips_mode {
typedef struct character_set {
unsigned int number; /* character set number */
unsigned int state; /* character set state */
const char *csname; /* collation name */
const char *name; /* character set name */
const char *csname; /* character set name */
const char *name; /* collation name */
const char *comment; /* comment */
const char *dir; /* character set directory */
unsigned int mbminlen; /* min. length for multibyte strings */
Expand Down Expand Up @@ -362,6 +366,22 @@ typedef struct MYSQL_RES {
*/
#define MYSQL_RPL_SKIP_HEARTBEAT (1 << 17)

/**
Flag to indicate that the heartbeat_event being generated
is using the class Heartbeat_event_v2
*/
#define USE_HEARTBEAT_EVENT_V2 (1 << 1)

/**
Flag to indicate that tagged GTIDS will be skipped in COM_BINLOG_DUMP_GTIDS
*/
#define MYSQL_RPL_SKIP_TAGGED_GTIDS (1 << 2)

/**
Tagged GTIDS are supported starting from below version of MySQL
*/
#define MYSQL_TAGGED_GTIDS_VERSION_SUPPORT 80300

/**
Struct for information about a replication stream.
Expand Down Expand Up @@ -403,7 +423,7 @@ void STDCALL mysql_server_end(void);
/*
mysql_server_init/end need to be called when using libmysqld or
libmysqlclient (exactly, mysql_server_init() is called by mysql_init() so
you don't need to call it explicitely; but you need to call
you don't need to call it explicitly; but you need to call
mysql_server_end() to free memory). The names are a bit misleading
(mysql_SERVER* to be used when using libmysqlCLIENT). So we add more general
names which suit well whether you're using libmysqld or libmysqlclient. We
Expand Down Expand Up @@ -453,6 +473,10 @@ bool STDCALL mysql_ssl_set(MYSQL *mysql, const char *key, const char *cert,
const char *ca, const char *capath,
const char *cipher);
const char *STDCALL mysql_get_ssl_cipher(MYSQL *mysql);
bool STDCALL mysql_get_ssl_session_reused(MYSQL *mysql);
void *STDCALL mysql_get_ssl_session_data(MYSQL *mysql, unsigned int n_ticket,
unsigned int *out_len);
bool STDCALL mysql_free_ssl_session_data(MYSQL *mysql, void *data);
bool STDCALL mysql_change_user(MYSQL *mysql, const char *user,
const char *passwd, const char *db);
MYSQL *STDCALL mysql_real_connect(MYSQL *mysql, const char *host,
Expand Down Expand Up @@ -556,6 +580,7 @@ void STDCALL myodbc_remove_escape(MYSQL *mysql, char *name);
unsigned int STDCALL mysql_thread_safe(void);
bool STDCALL mysql_read_query_result(MYSQL *mysql);
int STDCALL mysql_reset_connection(MYSQL *mysql);
enum net_async_status STDCALL mysql_reset_connection_nonblocking(MYSQL *mysql);

int STDCALL mysql_binlog_open(MYSQL *mysql, MYSQL_RPL *rpl);
int STDCALL mysql_binlog_fetch(MYSQL *mysql, MYSQL_RPL *rpl);
Expand Down Expand Up @@ -603,7 +628,7 @@ enum enum_mysql_stmt_state {
length - On input: in case when lengths of input values
are different for each execute, you can set this to
point at a variable containining value length. This
point at a variable containing value length. This
way the value length can be different in each execute.
If length is not NULL, buffer_length is not used.
Note, length can even point at buffer_length if
Expand Down Expand Up @@ -749,6 +774,8 @@ bool STDCALL mysql_stmt_attr_get(MYSQL_STMT *stmt,
enum enum_stmt_attr_type attr_type,
void *attr);
bool STDCALL mysql_stmt_bind_param(MYSQL_STMT *stmt, MYSQL_BIND *bnd);
bool STDCALL mysql_stmt_bind_named_param(MYSQL_STMT *stmt, MYSQL_BIND *binds,
unsigned n_params, const char **names);
bool STDCALL mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bnd);
bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt);
bool STDCALL mysql_stmt_reset(MYSQL_STMT *stmt);
Expand Down Expand Up @@ -795,6 +822,8 @@ MYSQL *STDCALL mysql_real_connect_dns_srv(MYSQL *mysql,
const char *db,
unsigned long client_flag);

enum connect_stage STDCALL mysql_get_connect_nonblocking_stage(MYSQL *mysql);

#ifdef __cplusplus
}
#endif
Expand Down
Loading

0 comments on commit 35339e3

Please sign in to comment.