From 908c9cf90cbada86fd25bd3b45d686c49d1dacf5 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Tue, 30 Jan 2024 17:00:15 +0100 Subject: [PATCH 1/8] workaround for MDEV-33218 --- sql/sql_lex.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 847bd1d72d2..9ef08bd346a 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -4146,9 +4146,12 @@ void st_select_lex::fix_prepare_information(THD *thd, Item **conds, { Query_arena_stmt on_stmt_arena(thd); changed_elements|= TOUCHED_SEL_COND; + /* + TODO: return after MDEV-33218 fix DBUG_ASSERT( active_arena->is_stmt_prepare_or_first_stmt_execute() || active_arena->state == Query_arena::STMT_SP_QUERY_ARGUMENTS); + */ if (group_list.first) { if (!group_list_ptrs) From d1744ee7a2f1ce5cab486ccf18a754ab3e8d8f63 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 31 Jan 2024 11:18:40 +0100 Subject: [PATCH 2/8] MDEV-33343 spider.mdev_28739_simple fails in buildbot test disabled, until fixed --- storage/spider/mysql-test/spider/bugfix/disabled.def | 1 + 1 file changed, 1 insertion(+) diff --git a/storage/spider/mysql-test/spider/bugfix/disabled.def b/storage/spider/mysql-test/spider/bugfix/disabled.def index 559feeff4bd..7b5c72823b7 100644 --- a/storage/spider/mysql-test/spider/bugfix/disabled.def +++ b/storage/spider/mysql-test/spider/bugfix/disabled.def @@ -1,2 +1,3 @@ wait_timeout : MDEV-26045 mdev_27575 : MDEV-32997 +mdev_28739_simple : MDEV-33343 From e5147c8140450f28505a227159d2feba37dd1c39 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 30 Jan 2024 16:39:28 +0100 Subject: [PATCH 3/8] regression introduced by MDEV-14448 --- client/mysql.cc | 3 --- mysql-test/main/mysql-interactive.result | 24 ++++++++++++++++++++ mysql-test/main/mysql-interactive.test | 29 ++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 mysql-test/main/mysql-interactive.result create mode 100644 mysql-test/main/mysql-interactive.test diff --git a/client/mysql.cc b/client/mysql.cc index fe086f29dac..c917501fdc3 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2136,10 +2136,7 @@ static int read_and_execute(bool interactive) the readline/libedit library. */ if (line) - { free(line); - glob_buffer.length(0); - } line= readline(prompt); #ifdef USE_LIBEDIT_INTERFACE /* diff --git a/mysql-test/main/mysql-interactive.result b/mysql-test/main/mysql-interactive.result new file mode 100644 index 00000000000..a18c018b932 --- /dev/null +++ b/mysql-test/main/mysql-interactive.result @@ -0,0 +1,24 @@ +# +# regression introduced by MDEV-14448 +# +delimiter $ +select 1; +$ +Welcome to the MariaDB monitor. Commands end with ; or \g. +Your MariaDB connection id is X +Server version: Y +Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. + +Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. + +MariaDB [(none)]> delimiter $ +MariaDB [(none)]> select 1; + -> $ ++---+ +| 1 | ++---+ +| 1 | ++---+ +1 row in set + +MariaDB [(none)]> \ No newline at end of file diff --git a/mysql-test/main/mysql-interactive.test b/mysql-test/main/mysql-interactive.test new file mode 100644 index 00000000000..2015e9d667d --- /dev/null +++ b/mysql-test/main/mysql-interactive.test @@ -0,0 +1,29 @@ +--echo # +--echo # regression introduced by MDEV-14448 +--echo # +source include/not_embedded.inc; +source include/not_windows.inc; + +error 0,1; +exec $MYSQL -V|grep -q readline; +if ($sys_errno == 1) +{ + # strangely enough + skip does not work with libedit; +} + +write_file $MYSQL_TMP_DIR/mysql_in; +delimiter $ +select 1; +$ +EOF +let TERM=dumb; +replace_regex /id is \d+/id is X/ /Server version: .*/Server version: Y/ / \(\d+\.\d+ sec\)//; +error 0,127; +exec socat EXEC:"$MYSQL",pty STDIO < $MYSQL_TMP_DIR/mysql_in; +if ($sys_errno == 127) +{ + remove_file $MYSQL_TMP_DIR/mysql_in; + skip no socat; +} +remove_file $MYSQL_TMP_DIR/mysql_in; From 46e3a7658b774942e9320a1acb234373bb44e874 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 31 Jan 2024 17:07:46 +0100 Subject: [PATCH 4/8] funcs_1.innodb_views times out in --ps --- mysql-test/suite/funcs_1/views/views_master.inc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mysql-test/suite/funcs_1/views/views_master.inc b/mysql-test/suite/funcs_1/views/views_master.inc index 526e9e3426e..3b33f2150b1 100644 --- a/mysql-test/suite/funcs_1/views/views_master.inc +++ b/mysql-test/suite/funcs_1/views/views_master.inc @@ -3085,8 +3085,10 @@ eval SHOW CREATE VIEW test1.v$level; # the following line as written as '--eror ER_TOO_MANY_TABLES' and the command # is successful so assuming no expected error was intended # --error ER_TOO_MANY_TABLES +--disable_ps2_protocol eval SELECT CAST(f1 AS SIGNED INTEGER) AS f1, CAST(f2 AS CHAR) AS f2 FROM test1.v$level; +--enable_ps2_protocol let $message= The output of following EXPLAIN is deactivated, because the result differs on some platforms FIXME Is this a bug ? ; @@ -3116,16 +3118,20 @@ SELECT f1 as f2, f2 as f1 FROM test2.t1; CREATE OR REPLACE VIEW test2.v0 AS SELECT CAST('0001-01-01' AS DATE) as f1, f2 FROM test3.t1; eval SHOW CREATE VIEW test1.v$toplevel; +--disable_ps2_protocol eval SELECT CAST(f1 AS SIGNED INTEGER) AS f1, CAST(f2 AS CHAR) AS f2 FROM test1.v$toplevel; +--enable_ps2_protocol eval EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1, CAST(f2 AS CHAR) AS f2 FROM test1.v$toplevel; # 2.3.3 UCS2 string instead of common string CREATE OR REPLACE VIEW test3.v0 AS SELECT f1 , CONVERT('ßÄäÖöÜü§' USING UCS2) as f2 FROM test1.t1; eval SHOW CREATE VIEW test1.v$toplevel; +--disable_ps2_protocol eval SELECT CAST(f1 AS SIGNED INTEGER) AS f1, CAST(f2 AS CHAR) AS f2 FROM test1.v$toplevel; +--enable_ps2_protocol eval EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1, CAST(f2 AS CHAR) AS f2 FROM test1.v$toplevel; @@ -3133,8 +3139,10 @@ eval EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1, CREATE OR REPLACE VIEW test3.v0 AS SELECT CONVERT('ßÄäÖöÜü§' USING UCS2) as f1, f2 FROM test1.t1; eval SHOW CREATE VIEW test1.v$toplevel; +--disable_ps2_protocol eval SELECT CAST(f1 AS SIGNED INTEGER) AS f1, CAST(f2 AS CHAR) AS f2 FROM test1.v$toplevel; +--enable_ps2_protocol eval EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1, CAST(f2 AS CHAR) AS f2 FROM test1.v$toplevel; --enable_result_log From 2278f3503e5239f3abf8f77cdc393e48297d48d9 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 31 Jan 2024 22:02:59 +0100 Subject: [PATCH 5/8] fix columnstore compilation on fc39 --- storage/columnstore/columnstore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/columnstore/columnstore b/storage/columnstore/columnstore index fcd637addcf..07e7301631a 160000 --- a/storage/columnstore/columnstore +++ b/storage/columnstore/columnstore @@ -1 +1 @@ -Subproject commit fcd637addcfbe0e9c55ebfc83303e8415cda8e96 +Subproject commit 07e7301631a5ac5ce86c3449d539eb4856119e1c From dd95c58b5864c8b6f57630df67afd19a9552350e Mon Sep 17 00:00:00 2001 From: Brandon Nesterenko Date: Tue, 30 Jan 2024 21:50:13 +0100 Subject: [PATCH 6/8] MDEV-33331: IO Thread Relay Log Inconsistent Statistics After MDEV-32551 After MDEV-32551, in a master/slave setup, if the replica's IO thread quickly and successively reconnects (i.e quickly running STOP SLAVE IO_THREAD followed by START SLAVE IO_THREAD), the relay log rotation behavior changes. That is, MDEV-32551 changed the logic of the binlog_dump_thread on the primary, such that it can stop itself before sending any events if it sees a new connection has been created to a replica with the same server_id. Pre MDEV-32551, the connection would establish and it would send a "fake" rotate event to populate the log name. Post MDEV-32551, the connection stops itself, and a rotate event is not sent. This made the test rpl.rpl_mariadb_slave_capability unstable because it is reliant on the name of the relay logs (which is dependent on the number of rotates); and the pre-amble of the test would quickly start/stop the IO thread. There a binlog dump thread could end itself before sending a rotate event to the replica, thereby changing the name of the relay log. This patch fixes this by adding in a synchronization in-between IO thread restarts, such that it waits for the primary's binlog dump threads to sync up with the state of the replica. --- .../suite/rpl/r/rpl_mariadb_slave_capability.result | 5 +++++ .../suite/rpl/t/rpl_mariadb_slave_capability.test | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result b/mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result index 68e8b22dd02..fddb07c9cbf 100644 --- a/mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result +++ b/mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result @@ -6,6 +6,11 @@ connection slave; include/stop_slave.inc CHANGE MASTER TO MASTER_USE_GTID=NO; include/start_slave.inc +connection master; +# Ensure only the new binlog dump thread is alive (wait for the old one +# to complete its kill) +# And that it has already sent its fake rotate +connection slave; include/stop_slave.inc # Test slave with no capability gets dummy event, which is ignored. set @old_dbug= @@global.debug_dbug; diff --git a/mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test b/mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test index 2ad9124d886..ee890a8fd03 100644 --- a/mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test +++ b/mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test @@ -18,6 +18,18 @@ connection slave; CHANGE MASTER TO MASTER_USE_GTID=NO; --source include/start_slave.inc +--connection master +--echo # Ensure only the new binlog dump thread is alive (wait for the old one +--echo # to complete its kill) +--let $wait_condition= select count(*)=1 from information_schema.processlist where command='Binlog Dump' +--source include/wait_condition.inc + +--echo # And that it has already sent its fake rotate +--let $wait_condition= select count(*)=1 from information_schema.processlist where state LIKE '%Master has sent all binlog to slave%' and command='Binlog Dump' +--source include/wait_condition.inc + + +--connection slave --source include/stop_slave.inc --echo # Test slave with no capability gets dummy event, which is ignored. set @old_dbug= @@global.debug_dbug; From 15c75ad083a55e198ae78324f22970694b72f22b Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 1 Feb 2024 11:26:36 +0100 Subject: [PATCH 7/8] pcre.cmake: always check the library with check_library_exists() even if pkg-config has it. otherwise build dependencies aren't detected. --- cmake/pcre.cmake | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/cmake/pcre.cmake b/cmake/pcre.cmake index c2eb26074ac..3c427b881fc 100644 --- a/cmake/pcre.cmake +++ b/cmake/pcre.cmake @@ -81,18 +81,15 @@ MACRO (CHECK_PCRE) FIND_PACKAGE(PkgConfig QUIET) PKG_CHECK_MODULES(PCRE libpcre2-8) # in case pkg-config or libpcre2-8.pc is not installed: - IF(NOT PCRE_FOUND) - UNSET(PCRE_FOUND CACHE) - CHECK_LIBRARY_EXISTS(pcre2-8 pcre2_match_8 "" PCRE_FOUND) - ENDIF() + CHECK_LIBRARY_EXISTS(pcre2-8 pcre2_match_8 "${PCRE_LIBRARY_DIRS}" HAVE_PCRE2_MATCH_8) ENDIF() - IF(NOT PCRE_FOUND OR WITH_PCRE STREQUAL "bundled") + IF(NOT HAVE_PCRE2_MATCH_8 OR WITH_PCRE STREQUAL "bundled") IF (WITH_PCRE STREQUAL "system") MESSAGE(FATAL_ERROR "system pcre2-8 library is not found or unusable") ENDIF() BUNDLE_PCRE2() ELSE() - CHECK_LIBRARY_EXISTS(pcre2-posix PCRE2regcomp "" NEEDS_PCRE2_DEBIAN_HACK) + CHECK_LIBRARY_EXISTS(pcre2-posix PCRE2regcomp "${PCRE_LIBRARY_DIRS}" NEEDS_PCRE2_DEBIAN_HACK) IF(NEEDS_PCRE2_DEBIAN_HACK) SET(PCRE2_DEBIAN_HACK "-Dregcomp=PCRE2regcomp -Dregexec=PCRE2regexec -Dregerror=PCRE2regerror -Dregfree=PCRE2regfree") ENDIF() From b5c367cd88e37091ab5f8dab0396c01c97d037e2 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 1 Feb 2024 16:15:02 +0100 Subject: [PATCH 8/8] MDEV-32815 test main.func_sformat Locale + test failures under Fedora 39 (fmt-10.0.0+) FMT_STATIC_THOUSANDS_SEPARATOR stopped working in 10.0.0 Let's not use this fmt version for now --- cmake/libfmt.cmake | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cmake/libfmt.cmake b/cmake/libfmt.cmake index 70b6a07216f..da3479424b1 100644 --- a/cmake/libfmt.cmake +++ b/cmake/libfmt.cmake @@ -1,4 +1,4 @@ -INCLUDE (CheckCXXSourceCompiles) +INCLUDE (CheckCXXSourceRuns) INCLUDE (ExternalProject) SET(WITH_LIBFMT "auto" CACHE STRING @@ -27,17 +27,15 @@ ENDMACRO() MACRO (CHECK_LIBFMT) IF(WITH_LIBFMT STREQUAL "system" OR WITH_LIBFMT STREQUAL "auto") SET(CMAKE_REQUIRED_INCLUDES ${LIBFMT_INCLUDE_DIR}) - CHECK_CXX_SOURCE_COMPILES( + CHECK_CXX_SOURCE_RUNS( "#define FMT_STATIC_THOUSANDS_SEPARATOR ',' #define FMT_HEADER_ONLY 1 #include - #include int main() { - int answer= 42; + int answer= 4321; fmt::format_args::format_arg arg= fmt::detail::make_arg(answer); - std::cout << fmt::vformat(\"The answer is {}.\", - fmt::format_args(&arg, 1)); + return fmt::vformat(\"{:L}\", fmt::format_args(&arg, 1)).compare(\"4,321\"); }" HAVE_SYSTEM_LIBFMT) SET(CMAKE_REQUIRED_INCLUDES) ENDIF()