diff --git a/router/tests/integration/test_routing_direct.cc b/router/tests/integration/test_routing_direct.cc index 6454b04aa355..43e7b40b8657 100644 --- a/router/tests/integration/test_routing_direct.cc +++ b/router/tests/integration/test_routing_direct.cc @@ -3717,7 +3717,9 @@ TEST_P(ConnectionTest, classic_protocol_session_vars_nullable) { "character_set_results", // "innodb_ft_user_stopword_table", // "innodb_interpreter_output", // debug - "session_track_system_variables")); + "session_track_system_variables", + "debug_set_operations_secondary_overflow_at", + "log_query_errors")); } } } diff --git a/unittest/gunit/CMakeLists.txt b/unittest/gunit/CMakeLists.txt index b572af5d712b..a283ebd8e6ea 100644 --- a/unittest/gunit/CMakeLists.txt +++ b/unittest/gunit/CMakeLists.txt @@ -115,7 +115,6 @@ SET(TESTS charset_bug32788301 collation_loader cost_estimate - dbug decimal dns_srv_data dphyp @@ -334,6 +333,22 @@ IF(HAS_WARN_FLAG) ADD_COMPILE_FLAGS(segfault-t.cc COMPILE_FLAGS ${HAS_WARN_FLAG}) ENDIF() +# Suppress warnings for gcc-10 or newer +IF(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0) + ADD_CXX_COMPILE_FLAGS_TO_FILES(-Wno-stringop-overflow FILES integer_digits-t.cc) +ENDIF() + +# Suppress warnings for gcc-14 or newer +IF(MY_COMPILER_IS_GNU AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 14) + ADD_COMPILE_FLAGS(hypergraph_optimizer-t.cc COMPILE_FLAGS "-Wno-array-bounds") +ENDIF() + +# Avoid 'requires dynamic R_X86_64_PC32 reloc' linker error for dd_sdi-t.cc +# when built with ASAN +IF(WITH_ASAN OR WITH_VALGRIND) + ADD_CXX_COMPILE_FLAGS_TO_FILES(-fPIC FILES dd_sdi-t.cc) +ENDIF() + # Warnings about missing PGO profile data are not useful for unit tests. DISABLE_MISSING_PROFILE_WARNING() diff --git a/unittest/gunit/dd.h b/unittest/gunit/dd.h index 5300c1e15b86..e26d0866133d 100644 --- a/unittest/gunit/dd.h +++ b/unittest/gunit/dd.h @@ -85,7 +85,7 @@ class Mock_dd_HANDLER : public Base_mock_HANDLER { Mock_dd_HANDLER(handlerton *hton, TABLE_SHARE *share) : Base_mock_HANDLER(hton, share) {} - virtual ~Mock_dd_HANDLER() = default; + ~Mock_dd_HANDLER() override {} }; /** diff --git a/unittest/gunit/innodb/lob/lot0buf.cc b/unittest/gunit/innodb/lob/lot0buf.cc index 3aa84e5a8d59..f90115a026f9 100644 --- a/unittest/gunit/innodb/lob/lot0buf.cc +++ b/unittest/gunit/innodb/lob/lot0buf.cc @@ -32,6 +32,7 @@ this program; if not, write to the Free Software Foundation, Inc., #include "lot0buf.h" #include "mach0data.h" +#include "my_compiler.h" #include "ut0byte.h" #include "ut0ut.h" diff --git a/unittest/gunit/innodb/log0log-t.cc b/unittest/gunit/innodb/log0log-t.cc index 4013a8db67ff..80c6e30d66ea 100644 --- a/unittest/gunit/innodb/log0log-t.cc +++ b/unittest/gunit/innodb/log0log-t.cc @@ -237,11 +237,6 @@ static bool log_test_recovery() { } else { srv_shutdown_state = SRV_SHUTDOWN_FLUSH_PHASE; - - /* XXX: Shouldn't this be guaranteed within log0recv.cc ? */ - while (srv_thread_is_active(srv_threads.m_recv_writer)) { - std::this_thread::sleep_for(std::chrono::milliseconds(100)); - } } recv_sys_close(); diff --git a/unittest/gunit/libmysqlgcs/xcom/gcs_xcom_control_interface-t.cc b/unittest/gunit/libmysqlgcs/xcom/gcs_xcom_control_interface-t.cc index d95d16e5574c..78f241d96172 100644 --- a/unittest/gunit/libmysqlgcs/xcom/gcs_xcom_control_interface-t.cc +++ b/unittest/gunit/libmysqlgcs/xcom/gcs_xcom_control_interface-t.cc @@ -928,6 +928,8 @@ TEST_F(XComControlTest, JoinTestSkipOwnNodeAndCycleThroughPeerNodes) { result = xcom_control_if->leave(); ASSERT_EQ(GCS_OK, result); ASSERT_FALSE(xcom_control_if->is_xcom_running()); + + free(con); } TEST_F(XComControlTest, JoinTestAllPeersUnavailable) { diff --git a/unittest/gunit/log_timestamp-t.cc b/unittest/gunit/log_timestamp-t.cc index 81487a9432db..30ec32b8b8fd 100644 --- a/unittest/gunit/log_timestamp-t.cc +++ b/unittest/gunit/log_timestamp-t.cc @@ -36,7 +36,7 @@ #include "test_utils.h" #include -#include "../sql/log.h" +#include "sql/log.h" // CET: 32 bytes // date (10), 'T', time (8), '.', microseconds (6), timezone offset (6) diff --git a/unittest/gunit/m_string-t.cc b/unittest/gunit/m_string-t.cc index d0897cd19e4b..827092bad53f 100644 --- a/unittest/gunit/m_string-t.cc +++ b/unittest/gunit/m_string-t.cc @@ -65,6 +65,7 @@ TEST(MString, HumanReadableSize) { data_size *= 1000; EXPECT_EQ("1025000Y", HumanReadable(data_size)); data_size *= 1000; + EXPECT_EQ("1025000000Y", HumanReadable(data_size)); data_size *= static_cast(std::numeric_limits::max()); diff --git a/unittest/gunit/mdl-t.cc b/unittest/gunit/mdl-t.cc index 6189b54aa133..a0559f27635b 100644 --- a/unittest/gunit/mdl-t.cc +++ b/unittest/gunit/mdl-t.cc @@ -3783,7 +3783,11 @@ TEST_F(MDLTest, FindLockOwner) { Verify that correct error is reported when the MDL system exhausts the LF Pinbox. */ -TEST_F(MDLTest, ExhaustPinbox) { +/** + Disabled, because Percona Server allows up to 2^32 pins + and this test would take a lot of time +*/ +TEST_F(MDLTest, DISABLED_ExhaustPinbox) { for (int i = 0; i < 65535; ++i) { MDL_context c; EXPECT_FALSE(test_drive_fix_pins(&c)); diff --git a/unittest/gunit/mysys_my_b_vprintf-t.cc b/unittest/gunit/mysys_my_b_vprintf-t.cc index b31970408c45..17b20eaf19e2 100644 --- a/unittest/gunit/mysys_my_b_vprintf-t.cc +++ b/unittest/gunit/mysys_my_b_vprintf-t.cc @@ -31,7 +31,8 @@ void test1(const char *res, const char *fmt, ...) { IO_CACHE info; va_list args; size_t len; - init_io_cache(&info, -1, 0, WRITE_CACHE, 0, true, MYF(0)); + int init_res = init_io_cache(&info, -1, 0, WRITE_CACHE, 0, true, MYF(0)); + EXPECT_EQ(init_res, 0); memset(info.write_buffer, 0, 64); /* RECORD_CACHE_SIZE is 64K */ va_start(args, fmt); len = my_b_vprintf(&info, fmt, args); diff --git a/unittest/gunit/mysys_pathfuncs-t.cc b/unittest/gunit/mysys_pathfuncs-t.cc index a928a055b677..6483435d30b6 100644 --- a/unittest/gunit/mysys_pathfuncs-t.cc +++ b/unittest/gunit/mysys_pathfuncs-t.cc @@ -153,7 +153,7 @@ TEST(Mysys, CreateTempFile) { File fileno = create_temp_file(dst, "/tmp", prefix, 42, UNLINK_FILE, 0); EXPECT_GE(fileno, 0); my_close(fileno, 0); - EXPECT_THAT(dst, MatchesRegex("/tmp/[a]+fd=[0-9]+")); + EXPECT_THAT(dst, MatchesRegex("/tmp/[a]+(fd=[0-9]+|[a-zA-Z0-9]+)")); aset(dst, 0xaa); char *env_tmpdir = getenv("TMPDIR"); diff --git a/unittest/gunit/temptable_storage-t.cc b/unittest/gunit/temptable_storage-t.cc index c7b104b3b320..99f6fff3e5a4 100644 --- a/unittest/gunit/temptable_storage-t.cc +++ b/unittest/gunit/temptable_storage-t.cc @@ -38,9 +38,9 @@ TEST(StorageTest, Iterate) { std::thread t([]() { temptable::TableResourceMonitor table_resource_monitor(16 * 1024 * 1024); temptable::Block shared_block; - temptable::Allocator allocator(&shared_block, - table_resource_monitor); { + temptable::Allocator allocator(&shared_block, + table_resource_monitor); temptable::Storage storage(&allocator); storage.element_size(sizeof(uint64_t)); diff --git a/unittest/gunit/xplugin/xpl/CMakeLists.txt b/unittest/gunit/xplugin/xpl/CMakeLists.txt index be2e8a3eb58d..f64858c1424e 100644 --- a/unittest/gunit/xplugin/xpl/CMakeLists.txt +++ b/unittest/gunit/xplugin/xpl/CMakeLists.txt @@ -67,6 +67,10 @@ IF(WIN32) SET_TARGET_PROPERTIES(xplugin_unit_tests PROPERTIES COMPILE_FLAGS "/wd4373") ENDIF(WIN32) +IF(MY_COMPILER_IS_CLANG) + STRING_APPEND(CMAKE_CXX_FLAGS " -Wno-deprecated") +ENDIF() + TARGET_LINK_LIBRARIES(xplugin_unit_tests ${GCOV_LDFLAGS} ${MYSQLX_CLIENT_LIB} diff --git a/unittest/gunit/xplugin/xpl/mysql_function_names.cmake b/unittest/gunit/xplugin/xpl/mysql_function_names.cmake index aed15675ae4f..e1a274d29d29 100644 --- a/unittest/gunit/xplugin/xpl/mysql_function_names.cmake +++ b/unittest/gunit/xplugin/xpl/mysql_function_names.cmake @@ -75,4 +75,3 @@ GET_OTHER_FUNCTION_NAMES(${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy OTHER_MYSQL_FUNCT CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_function_names_t.cc.in ${MYSQLX_GENERATE_DIR}/mysql_function_names_t.cc) -