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] 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;