Skip to content

Commit

Permalink
Implemented PS-8723 (Merge MySQL 8.0.33) (conflicts solved)
Browse files Browse the repository at this point in the history
  • Loading branch information
inikep committed May 3, 2023
1 parent 633dd61 commit a51e3a5
Show file tree
Hide file tree
Showing 168 changed files with 639 additions and 7,704 deletions.
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,8 @@ __pycache__/
heatwaveml.*
automl.egg-info/
_userconf.sh
<<<<<<< HEAD
scalability_jobs_*
||||||| ce0de82d3aa
scalability_jobs_*
=======
scalability_jobs_*
# Configuration files for Eclipse
.cproject
.project
.settings/
>>>>>>> mysql-8.0.33
10 changes: 0 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1395,21 +1395,11 @@ IF(CMAKE_C_LINK_FLAGS MATCHES "-fuse-ld=gold" OR
"-fuse-ld=gold" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
ENDIF()

<<<<<<< HEAD
# Linker/binutils bug in Fedora 28, Ubuntu 16.04, Debian 8 and Debian 9,
# undefined reference to symbol '__bss_start'
# Fedora 34: undefined reference to symbol 'crc32_z@@ZLIB_1.2.9'
IF(LINUX_FEDORA_34 OR LINUX_RHEL9 OR LINUX_DEBIAN_8 OR LINUX_DEBIAN_9)
IF(NOT CMAKE_CXX_LINK_FLAGS MATCHES "-fuse-ld=lld")
||||||| ce0de82d3aa
# Fedora 34, RHEL9: undefined reference to symbol 'crc32_z@@ZLIB_1.2.9'
IF(LINUX_FEDORA_34 OR LINUX_RHEL9)
IF(NOT CMAKE_CXX_LINK_FLAGS MATCHES "-fuse-ld=lld")
=======
# Fedora 34, RHEL9: undefined reference to symbol 'crc32_z@@ZLIB_1.2.9'
IF(LINUX_FEDORA_34 OR LINUX_RHEL9)
IF(NOT USING_LD_LLD)
>>>>>>> mysql-8.0.33
STRING_APPEND(CMAKE_CXX_LINK_FLAGS " -Wl,--copy-dt-needed-entries")
ENDIF()
ENDIF()
Expand Down
10 changes: 1 addition & 9 deletions MYSQL_VERSION
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
MYSQL_VERSION_MAJOR=8
MYSQL_VERSION_MINOR=0
<<<<<<< HEAD
MYSQL_VERSION_PATCH=32
MYSQL_VERSION_EXTRA=-24
||||||| ce0de82d3aa
MYSQL_VERSION_PATCH=32
MYSQL_VERSION_EXTRA=
=======
MYSQL_VERSION_PATCH=33
MYSQL_VERSION_EXTRA=
>>>>>>> mysql-8.0.33
MYSQL_VERSION_EXTRA=-25
4 changes: 2 additions & 2 deletions client/mysqlbinlog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2920,8 +2920,8 @@ class Mysqlbinlog_event_data_istream : public Binlog_event_data_istream {
return error || rewrite_db(buffer, length);
}

bool start_decryption(
binary_log::Start_encryption_event *see [[maybe_unused]]) {
bool start_decryption(binary_log::Start_encryption_event *see
[[maybe_unused]]) {
m_binlog_5_7_encrypted = true;
return false;
}
Expand Down
109 changes: 21 additions & 88 deletions client/mysqldump.cc
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,6 @@ bool is_infoschema_db(const char *db);
static char *primary_key_fields(const char *table_name, const bool desc);
static bool get_view_structure(char *table, char *db);
static bool dump_all_views_in_db(char *database);
static bool get_gtid_mode(MYSQL *mysql_con);
static int dump_all_tablespaces();
static int dump_tablespaces_for_tables(char *db, char **table_names,
int tables);
Expand Down Expand Up @@ -6279,38 +6278,6 @@ static int replace(DYNAMIC_STRING *ds_str, const char *search_str,
return 0;
}

/**
This function checks if GTIDs are enabled on the server.
@param[in] mysql_con the connection to the server
@retval true if GTIDs are enabled on the server
@retval false if GTIDs are disabled on the server
*/
static bool get_gtid_mode(MYSQL *mysql_con) {
MYSQL_RES *gtid_mode_res;
MYSQL_ROW gtid_mode_row;
bool gtid_mode = false;
char *gtid_mode_val = nullptr;

if (mysql_query_with_error_report(mysql_con, &gtid_mode_res,
"SHOW VARIABLES LIKE 'gtid_mode'"))
return false;

gtid_mode_row = mysql_fetch_row(gtid_mode_res);

/*
gtid_mode_row is NULL for pre 5.6 versions. For versions >= 5.6,
get the gtid_mode value from the second column.
*/
gtid_mode_val = gtid_mode_row ? (char *)gtid_mode_row[1] : nullptr;
gtid_mode = (gtid_mode_val && strcmp(gtid_mode_val, "OFF")) ? true : false;
mysql_free_result(gtid_mode_res);

return gtid_mode;
}

/**
This function sets the session binlog in the dump file.
When --set-gtid-purged is used, this function is called to
Expand Down Expand Up @@ -6441,34 +6408,39 @@ static bool add_set_gtid_purged(MYSQL *mysql_con, bool ftwrl_done) {
@param[in] mysql_con the connection to the server
@param[in] ftwrl_done FLUSH TABLES WITH READ LOCK query was issued
@param[in] is_gtid_enabled true if server has gtid_mode on
@retval false successful according to the value
of opt_set_gtid_purged.
@retval true fail.
*/

<<<<<<< HEAD
static bool process_set_gtid_purged(MYSQL *mysql_con, bool ftwrl_done) {
MYSQL_RES *gtid_mode_res;
MYSQL_ROW gtid_mode_row;
char *gtid_mode_val = nullptr;
char buf[32], query[64];

||||||| ce0de82d3aa
static bool process_set_gtid_purged(MYSQL *mysql_con) {
MYSQL_RES *gtid_mode_res;
MYSQL_ROW gtid_mode_row;
char *gtid_mode_val = nullptr;
char buf[32], query[64];

=======
static bool process_set_gtid_purged(MYSQL *mysql_con, bool is_gtid_enabled) {
>>>>>>> mysql-8.0.33
if (opt_set_gtid_purged_mode == SET_GTID_PURGED_OFF)
return false; /* nothing to be done */

if (is_gtid_enabled) {
/*
Check if the server has the knowledge of GTIDs(pre mysql-5.6)
or if the gtid_mode is ON or OFF.
*/
snprintf(query, sizeof(query), "SHOW VARIABLES LIKE %s",
quote_for_like("gtid_mode", buf));

if (mysql_query_with_error_report(mysql_con, &gtid_mode_res, query))
return true;

gtid_mode_row = mysql_fetch_row(gtid_mode_res);

/*
gtid_mode_row is NULL for pre 5.6 versions. For versions >= 5.6,
get the gtid_mode value from the second column.
*/
gtid_mode_val = gtid_mode_row ? (char *)gtid_mode_row[1] : nullptr;

if (gtid_mode_val && strcmp(gtid_mode_val, "OFF")) {
/*
For any gtid_mode !=OFF and irrespective of --set-gtid-purged
being AUTO or ON, add GTID_PURGED in the output.
Expand All @@ -6485,26 +6457,21 @@ static bool process_set_gtid_purged(MYSQL *mysql_con, bool is_gtid_enabled) {
}

set_session_binlog(false);
<<<<<<< HEAD
if (add_set_gtid_purged(mysql_con, ftwrl_done)) {
mysql_free_result(gtid_mode_res);
||||||| ce0de82d3aa
if (add_set_gtid_purged(mysql_con)) {
mysql_free_result(gtid_mode_res);
=======
if (add_set_gtid_purged(mysql_con)) {
>>>>>>> mysql-8.0.33
return true;
}
} else /* gtid_mode is off */
{
if (opt_set_gtid_purged_mode == SET_GTID_PURGED_ON ||
opt_set_gtid_purged_mode == SET_GTID_PURGED_COMMENTED) {
fprintf(stderr, "Error: Server has GTIDs disabled.\n");
mysql_free_result(gtid_mode_res);
return true;
}
}

mysql_free_result(gtid_mode_res);
return false;
}

Expand Down Expand Up @@ -6858,8 +6825,6 @@ static int execute_sql_file(const char *sql_file) {
#endif // NDEBUG

int main(int argc, char **argv) {
bool server_with_gtids_and_opt_purge_not_off = false;
bool server_has_gtid_enabled = false;
char bin_log_name[FN_REFLEN];
int exit_code, md_result_fd = 0;
bool has_consistent_binlog_pos = false;
Expand Down Expand Up @@ -6911,7 +6876,6 @@ int main(int argc, char **argv) {

if (opt_slave_data && do_stop_slave_sql(mysql)) goto err;

<<<<<<< HEAD
if (opt_single_transaction && opt_master_data) {
/*
See if we can avoid FLUSH TABLES WITH READ LOCK with Binlog_snapshot_*
Expand Down Expand Up @@ -6947,39 +6911,14 @@ int main(int argc, char **argv) {
if (do_flush_tables_read_lock(mysql)) goto err;
ftwrl_done = true;
} else if (opt_lock_for_backup && do_lock_tables_for_backup(mysql))
||||||| ce0de82d3aa
if ((opt_lock_all_tables || opt_master_data || opt_single_transaction) &&
do_flush_tables_read_lock(mysql))
=======
server_has_gtid_enabled = get_gtid_mode(mysql);

server_with_gtids_and_opt_purge_not_off =
(server_has_gtid_enabled &&
(opt_set_gtid_purged_mode != SET_GTID_PURGED_OFF));

if ((opt_lock_all_tables || opt_master_data ||
(opt_single_transaction &&
(flush_logs || server_with_gtids_and_opt_purge_not_off))) &&
do_flush_tables_read_lock(mysql))
>>>>>>> mysql-8.0.33
goto err;

/*
Flush logs before starting transaction since
this causes implicit commit starting mysql-5.5.
*/
<<<<<<< HEAD
if (opt_lock_all_tables || opt_master_data ||
(opt_single_transaction && flush_logs) || opt_delete_master_logs) {
||||||| ce0de82d3aa
if (opt_lock_all_tables || opt_master_data || opt_single_transaction ||
opt_delete_master_logs) {
=======
if (opt_lock_all_tables || opt_master_data ||
(opt_single_transaction &&
(flush_logs || server_with_gtids_and_opt_purge_not_off)) ||
opt_delete_master_logs) {
>>>>>>> mysql-8.0.33
if (flush_logs || opt_delete_master_logs) {
if (mysql_refresh(mysql, REFRESH_LOG)) {
DB_error(mysql, "when doing refresh");
Expand Down Expand Up @@ -7008,13 +6947,7 @@ int main(int argc, char **argv) {

/* Process opt_set_gtid_purged and add SET @@GLOBAL.GTID_PURGED if required.
*/
<<<<<<< HEAD
if (process_set_gtid_purged(mysql, ftwrl_done)) goto err;
||||||| ce0de82d3aa
if (process_set_gtid_purged(mysql)) goto err;
=======
if (process_set_gtid_purged(mysql, server_has_gtid_enabled)) goto err;
>>>>>>> mysql-8.0.33

if (opt_master_data &&
do_show_master_status(mysql, has_consistent_binlog_pos))
Expand Down
6 changes: 0 additions & 6 deletions cmake/do_abi_check.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,5 @@ FOREACH(file ${ABI_HEADERS})
"ABI check found difference between ${file}.pp and ${abi_check_out}, "
"compilation error file can be found here: ${errorfile}")
ENDIF()
<<<<<<< HEAD
FILE(REMOVE ${errorfile})
FILE(REMOVE ${abi_check_out})
||||||| ce0de82d3aa
FILE(REMOVE ${abi_check_out})
=======
>>>>>>> mysql-8.0.33
ENDFOREACH()
15 changes: 0 additions & 15 deletions cmake/lz4.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,9 @@
# cmake -DWITH_LZ4=system|bundled
# bundled is the default

<<<<<<< HEAD
SET(LIBLZ4_VERSION_REQUIRED "1.9.3")

MACRO(FIND_LZ4_VERSION)
||||||| ce0de82d3aa
MACRO(FIND_LZ4_VERSION)
=======
FUNCTION(FIND_LZ4_VERSION LZ4_INCLUDE_DIR)
>>>>>>> mysql-8.0.33
FOREACH(version_part
LZ4_VERSION_MAJOR
LZ4_VERSION_MINOR
Expand All @@ -47,20 +41,11 @@ FUNCTION(FIND_LZ4_VERSION LZ4_INCLUDE_DIR)
"${LZ4_VERSION_MAJOR}.${LZ4_VERSION_MINOR}.${LZ4_VERSION_RELEASE}")
MESSAGE(STATUS "LZ4_VERSION (${WITH_LZ4}) is ${LZ4_VERSION}")
MESSAGE(STATUS "LZ4_INCLUDE_DIR ${LZ4_INCLUDE_DIR}")
<<<<<<< HEAD
MESSAGE(STATUS "LZ4_LIBRARY ${LZ4_LIBRARY}")

IF (${LZ4_VERSION} VERSION_LESS ${LIBLZ4_VERSION_REQUIRED})
MESSAGE(FATAL_ERROR "Required liblz4 ${LIBLZ4_VERSION_REQUIRED} and installed version is ${LZ4_VERSION}")
ENDIF()
ENDMACRO()
||||||| ce0de82d3aa
MESSAGE(STATUS "LZ4_LIBRARY ${LZ4_LIBRARY}")
ENDMACRO()
=======
ENDFUNCTION(FIND_LZ4_VERSION)
>>>>>>> mysql-8.0.33


FUNCTION(FIND_SYSTEM_LZ4)
FIND_PATH(LZ4_INCLUDE_DIR
Expand Down
10 changes: 1 addition & 9 deletions cmake/readline.cmake
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
<<<<<<< HEAD
# Copyright (c) 2009, 2022, Oracle and/or its affiliates.
#
||||||| ce0de82d3aa
# Copyright (c) 2009, 2022, Oracle and/or its affiliates.
#
=======
# Copyright (c) 2009, 2023, Oracle and/or its affiliates.
#
>>>>>>> mysql-8.0.33
#
# 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.
Expand Down
8 changes: 0 additions & 8 deletions cmake/zstd.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,7 @@ FUNCTION(MYSQL_USE_BUNDLED_ZSTD)
FIND_ZSTD_VERSION(${BUNDLED_ZSTD_PATH})

ADD_SUBDIRECTORY(extra/zstd)
<<<<<<< HEAD
# The following flag is still used by RocksDB
SET(BUILD_BUNDLED_ZSTD 1)
ENDMACRO()
||||||| ce0de82d3aa
ENDMACRO()
=======
ENDFUNCTION(MYSQL_USE_BUNDLED_ZSTD)
>>>>>>> mysql-8.0.33

MACRO (MYSQL_CHECK_ZSTD)
IF(NOT WITH_ZSTD)
Expand Down
1 change: 1 addition & 0 deletions include/my_alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

#include <string.h>

#include <cstdint>
#include <memory>
#include <new>
#include <type_traits>
Expand Down
8 changes: 1 addition & 7 deletions include/my_sys.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
<<<<<<< HEAD
/* Copyright (c) 2000, 2022, Oracle and/or its affiliates.
Copyright (c) 2018, Percona and/or its affiliates.
||||||| ce0de82d3aa
/* Copyright (c) 2000, 2022, Oracle and/or its affiliates.
=======
/* Copyright (c) 2000, 2023, Oracle and/or its affiliates.
>>>>>>> mysql-8.0.33
Copyright (c) 2018, Percona 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,
Expand Down
6 changes: 6 additions & 0 deletions include/mysql/components/services/psi_thread_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,12 @@ set_thread_command_v1_t set_thread_command;
set_connection_type_v1_t set_connection_type;
/** @sa set_thread_start_time_v1_t. */
set_thread_start_time_v1_t set_thread_start_time;
/** @sa set_thread_start_time_usec_v4_t. */
set_thread_start_time_usec_v4_t set_thread_start_time_usec;
/** @sa set_thread_rows_sent_v4_t. */
set_thread_rows_sent_v4_t set_thread_rows_sent;
/** @sa set_thread_rows_examined_v4_t. */
set_thread_rows_examined_v4_t set_thread_rows_examined;
/** @sa set_thread_info_v1_t. */
set_thread_info_v1_t set_thread_info;
/** @sa set_thread_secondary_engine_v6_t. */
Expand Down
Loading

0 comments on commit a51e3a5

Please sign in to comment.