mirror of
https://github.com/MariaDB/server.git
synced 2025-03-31 12:25:38 +02:00
MDEV-35050 Found wrong usage of mutex upon setting plugin session variables
This commit is contained in:
parent
b1bbdbab9e
commit
9021f40b8e
3 changed files with 25 additions and 5 deletions
|
@ -1,3 +1,6 @@
|
|||
#
|
||||
# BUG#39746 - Debug flag breaks struct definition (server crash)
|
||||
#
|
||||
INSTALL PLUGIN simple_parser SONAME 'mypluglib.so';
|
||||
CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a) WITH PARSER simple_parser);
|
||||
ALTER TABLE t1 ADD FULLTEXT(b) WITH PARSER simple_parser;
|
||||
|
@ -5,3 +8,11 @@ DROP TABLE t1;
|
|||
UNINSTALL PLUGIN simple_parser;
|
||||
show status like 'a%status';
|
||||
Variable_name Value
|
||||
#
|
||||
# MDEV-35050 Found wrong usage of mutex upon setting plugin session variables
|
||||
#
|
||||
install soname 'mypluglib';
|
||||
set session_track_system_variables="*";
|
||||
set session simple_parser_simple_thdvar_one = 10;
|
||||
uninstall soname 'mypluglib';
|
||||
# End of 10.5 tests
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
--source include/have_simple_parser.inc
|
||||
|
||||
#
|
||||
# BUG#39746 - Debug flag breaks struct definition (server crash)
|
||||
#
|
||||
--echo #
|
||||
--echo # BUG#39746 - Debug flag breaks struct definition (server crash)
|
||||
--echo #
|
||||
--replace_result .dll .so
|
||||
eval INSTALL PLUGIN simple_parser SONAME '$MYPLUGLIB_SO';
|
||||
CREATE TABLE t1(a TEXT, b TEXT, FULLTEXT(a) WITH PARSER simple_parser);
|
||||
|
@ -15,3 +15,12 @@ UNINSTALL PLUGIN simple_parser;
|
|||
#
|
||||
show status like 'a%status';
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-35050 Found wrong usage of mutex upon setting plugin session variables
|
||||
--echo #
|
||||
install soname 'mypluglib';
|
||||
set session_track_system_variables="*";
|
||||
set session simple_parser_simple_thdvar_one = 10;
|
||||
uninstall soname 'mypluglib';
|
||||
|
||||
--echo # End of 10.5 tests
|
||||
|
|
|
@ -428,6 +428,7 @@ bool Session_sysvars_tracker::vars_list::store(THD *thd, String *buf)
|
|||
SHOW_VAR show;
|
||||
CHARSET_INFO *charset;
|
||||
size_t val_length, length;
|
||||
mysql_mutex_lock(&LOCK_global_system_variables);
|
||||
mysql_mutex_lock(&LOCK_plugin);
|
||||
if (!*node->test_load)
|
||||
{
|
||||
|
@ -444,13 +445,12 @@ bool Session_sysvars_tracker::vars_list::store(THD *thd, String *buf)
|
|||
show.name= svar->name.str;
|
||||
show.value= (char *) svar;
|
||||
|
||||
mysql_mutex_lock(&LOCK_global_system_variables);
|
||||
const char *value= get_one_variable(thd, &show, OPT_SESSION, SHOW_SYS, NULL,
|
||||
&charset, val_buf, &val_length);
|
||||
mysql_mutex_unlock(&LOCK_global_system_variables);
|
||||
|
||||
if (is_plugin)
|
||||
mysql_mutex_unlock(&LOCK_plugin);
|
||||
mysql_mutex_unlock(&LOCK_global_system_variables);
|
||||
|
||||
length= net_length_size(svar->name.length) +
|
||||
svar->name.length +
|
||||
|
|
Loading…
Add table
Reference in a new issue