From 1b9d5cdb83f235f313ae19bab1c6978837a566d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 28 Mar 2025 08:38:04 +0200 Subject: [PATCH 1/2] MDEV-35813: Valgrind test fixup log_checkpoint(): In cmake -DWITH_VALGRIND=ON builds, let us wait for all outstanding writes to complete, in order to avoid an unexpectedly large number of innodb_log_writes in the test innodb.page_cleaner. --- storage/innobase/buf/buf0flu.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc index f62d9dc0f3c..edeb210f6f7 100644 --- a/storage/innobase/buf/buf0flu.cc +++ b/storage/innobase/buf/buf0flu.cc @@ -1879,6 +1879,14 @@ static bool log_checkpoint() noexcept if (recv_recovery_is_on()) recv_sys.apply(true); +#if defined HAVE_valgrind && !__has_feature(memory_sanitizer) + /* The built-in scheduler in Valgrind may neglect some threads for a + long time. Under Valgrind, let us explicitly wait for page write + completion in order to avoid a result difference in the test + innodb.page_cleaner. */ + os_aio_wait_until_no_pending_writes(false); +#endif + switch (srv_file_flush_method) { case SRV_NOSYNC: case SRV_O_DIRECT_NO_FSYNC: From 31c06951c61fc3f9c5356c39088231f89e209b78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 28 Mar 2025 09:05:20 +0200 Subject: [PATCH 2/2] MDEV-36420 Assertion failure in SET GLOBAL innodb_ft_aux_table innodb_ft_aux_table_validate(): If the table is found in InnoDB but not valid for the parameter, only invoke dict_sys.unlock() once. This fixes a regression due to MDEV-36122. --- mysql-test/suite/innodb_fts/r/innodb_ft_aux_table.result | 9 +++++++++ mysql-test/suite/innodb_fts/t/innodb_ft_aux_table.test | 9 +++++++++ storage/innobase/handler/ha_innodb.cc | 3 ++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/innodb_fts/r/innodb_ft_aux_table.result b/mysql-test/suite/innodb_fts/r/innodb_ft_aux_table.result index a1ffb0a5d09..34416dff883 100644 --- a/mysql-test/suite/innodb_fts/r/innodb_ft_aux_table.result +++ b/mysql-test/suite/innodb_fts/r/innodb_ft_aux_table.result @@ -118,4 +118,13 @@ KEY VALUE SELECT @@GLOBAL.innodb_ft_aux_table; @@GLOBAL.innodb_ft_aux_table test/t1 +CREATE TABLE t(a INT) ENGINE=InnoDB; +SET GLOBAL innodb_ft_aux_table='test/t'; +ERROR 42000: Variable 'innodb_ft_aux_table' can't be set to the value of 'test/t' +DROP TABLE t; +SET GLOBAL innodb_ft_aux_table='test/t'; +ERROR 42000: Variable 'innodb_ft_aux_table' can't be set to the value of 'test/t' +SELECT @@GLOBAL.innodb_ft_aux_table; +@@GLOBAL.innodb_ft_aux_table +test/t1 SET GLOBAL innodb_ft_aux_table = @save_ft_aux_table; diff --git a/mysql-test/suite/innodb_fts/t/innodb_ft_aux_table.test b/mysql-test/suite/innodb_fts/t/innodb_ft_aux_table.test index f9447aada60..2c0972083c9 100644 --- a/mysql-test/suite/innodb_fts/t/innodb_ft_aux_table.test +++ b/mysql-test/suite/innodb_fts/t/innodb_ft_aux_table.test @@ -41,4 +41,13 @@ SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE; SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE; SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_CONFIG; SELECT @@GLOBAL.innodb_ft_aux_table; + +CREATE TABLE t(a INT) ENGINE=InnoDB; +--error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL innodb_ft_aux_table='test/t'; +DROP TABLE t; +--error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL innodb_ft_aux_table='test/t'; +SELECT @@GLOBAL.innodb_ft_aux_table; + SET GLOBAL innodb_ft_aux_table = @save_ft_aux_table; diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index fdfd0cb395d..d9919c5ed77 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -17541,8 +17541,9 @@ static int innodb_ft_aux_table_validate(THD *thd, st_mysql_sys_var*, *static_cast(save) = table_name; return 0; } + } else { + dict_sys.unlock(); } - dict_sys.unlock(); return 1; } else { *static_cast(save) = NULL;