1
0
mirror of https://github.com/MariaDB/server.git synced 2025-05-25 13:42:52 +03:00
mariadb/mysql-test/suite/innodb/t/innodb_sys_var_valgrind.test
Marko Mäkelä 7041807476 MDEV-22393 Corruption for SET GLOBAL innodb_ string variables
Several MYSQL_SYSVAR_STR parameters that employ both a validate
function callback fail to copy the string for saving the
validated value. The affected variables include the following:

innodb_ft_aux_table
innodb_ft_server_stopword_table
innodb_ft_user_stopword_table
innodb_buffer_pool_filename

The test case is an enhanced version of
mysql/mysql-server@0b0c30641f
and the code changes are inspired by their fixes.

We are also importing and adjusting the test innodb_fts.stopword
to get coverage for the variable innodb_ft_user_stopword_table.

buf_dump(), buf_load(): Protect srv_buf_dump_filename with
LOCK_global_system_variables.

fts_load_user_stopword(): Minor cleanup

fts_load_stopword(): Remove the parameter global_stopword_table.

innobase_fts_load_stopword(): Protect innodb_server_stopword_table
against concurrent SET GLOBAL.
2020-04-28 16:09:07 +03:00

71 lines
2.1 KiB
Plaintext

--source include/have_innodb.inc
--echo #
--echo # Bug #29717909 MEMORY LIFETIME OF VARIABLES BETWEEN CHECK AND UPDATE INCORRECTLY MANAGED
--echo #
#Test innodb_ft_server_stopword_table (global variable)
select @@innodb_ft_server_stopword_table;
create table user_stopword_1(value varchar(30)) engine = innodb;
create table user_stopword_2(value varchar(30)) engine = innodb;
set @blah = 'test/user_stopword_1';
SET GLOBAL innodb_ft_server_stopword_table= @blah;
select @@innodb_ft_server_stopword_table;
set @blah = 'test/user_stopword_2';
SET GLOBAL innodb_ft_server_stopword_table= @blah;
select @@innodb_ft_server_stopword_table;
SET GLOBAL innodb_ft_server_stopword_table= NULL;
select @@innodb_ft_server_stopword_table;
SET GLOBAL innodb_ft_server_stopword_table= default;
select @@innodb_ft_server_stopword_table;
drop table user_stopword_1, user_stopword_2;
#Test innodb_buffer_pool_filename (global variable)
select @@innodb_buffer_pool_filename;
set @blah='hello';
set global innodb_buffer_pool_filename = @blah;
select @@innodb_buffer_pool_filename;
set global innodb_buffer_pool_filename="bye";
select @@innodb_buffer_pool_filename;
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_buffer_pool_filename=NULL;
select @@innodb_buffer_pool_filename;
set global innodb_buffer_pool_filename=default;
select @@innodb_buffer_pool_filename;
#Test innodb_ft_aux_table (global variable)
CREATE TABLE t1 ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
opening_line TEXT(500), author VARCHAR(200), title VARCHAR(200), FULLTEXT idx
(opening_line)) ENGINE=InnoDB;
CREATE TABLE t2 ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
opening_line TEXT(500), author VARCHAR(200), title VARCHAR(200), FULLTEXT idx
(opening_line)) ENGINE=InnoDB;
select @@innodb_ft_aux_table;
set @blah = 'test/t1';
SET GLOBAL innodb_ft_aux_table = @blah;
select @@innodb_ft_aux_table;
set @blah = 'test/t2';
SET GLOBAL innodb_ft_aux_table = @blah;
SET GLOBAL innodb_ft_aux_table = NULL;
select @@innodb_ft_aux_table;
SET GLOBAL innodb_ft_aux_table =default;
select @@innodb_ft_aux_table;
drop table t1,t2;