1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Bug#18903155: BACKPORT BUG-18008907 TO 5.5+ VERSIONS.

Backporting patch committed for bug 18008907 to 5.5
and 5.6.
This commit is contained in:
Praveenkumar Hulakund
2014-06-27 17:04:08 +05:30
parent 70eca99172
commit b2c2656b62
6 changed files with 227 additions and 6 deletions

View File

@ -143,3 +143,73 @@ SELECT @@SESSION.example_double_thdvar;
@@SESSION.example_double_thdvar
1000.500000
UNINSTALL PLUGIN example;
#
# BUG#18008907 - DEADLOCK BETWEEN MYSQL_CHANGE_USER(), SHOW VARIABLES AND INSTALL PLUGIN
#
CREATE PROCEDURE p_install()
BEGIN
INSTALL PLUGIN no_such_plugin SONAME 'no_such_object';
END
|
CREATE PROCEDURE p_show_vars()
BEGIN
SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES;
END|
connect con1, localhost, root,,;
# Case 18008907_1: Deadlock situation cause by
# con1: has LOCK_system_variables_hash and waits on LOCK_plugin AND
# default: has LOCK_plugin and waits on LOCK_system_variables_hash.
#
SET DEBUG_SYNC='acquired_LOCK_system_variables_hash SIGNAL install_plugin WAIT_FOR cont_show_vars';
call p_show_vars();;
connection default;
SET DEBUG_SYNC='now WAIT_FOR install_plugin';
SET DEBUG_SYNC='acquired_LOCK_plugin SIGNAL cont_show_vars';
call p_install();;
connection con1;
COUNT(*)
#
SET DEBUG_SYNC='RESET';
connection default;
ERROR HY000: Can't open shared library
SET DEBUG_SYNC='RESET';
# Case 18008907_2: Deadlock situation caused by
# default: has LOCK_system_variables_hash and waits on LOCK_global_system_variables,
# con1: has LOCK_plugin and waits on LOCK_system_variables_hash AND
# con2: has LOCK_global_system_variables and waits on LOCK_plugin.
SET DEBUG_SYNC='acquired_LOCK_system_variables_hash SIGNAL install_plugin WAIT_FOR nothing TIMEOUT 10';
call p_show_vars();;
connection con1;
SET DEBUG_SYNC='now WAIT_FOR install_plugin';
SET DEBUG_SYNC='acquired_LOCK_plugin SIGNAL create_connection WAIT_FOR nothing TIMEOUT 10';
call p_install();;
connect con2, localhost, root,,;
SET DEBUG_SYNC='now WAIT_FOR create_connection';
connection con1;
ERROR HY000: Can't open shared library
connection default;
COUNT(*)
#
Warnings:
# 1639 debug sync point wait timed out
disconnect con2;
# Case 18008907_3: Testing Concurrent "Show Variables" and "Plugin Uninstall" operations.
INSTALL PLUGIN example SONAME 'ha_example.so';
connection con1;
SET DEBUG_SYNC='acquired_LOCK_system_variables_hash SIGNAL uninstall_plugin WAIT_FOR go';
call p_show_vars();;
connect con2, localhost, root,,;
SET DEBUG_SYNC='now WAIT_FOR uninstall_plugin';
UNINSTALL PLUGIN example;;
connection default;
SET DEBUG_SYNC='now SIGNAL go';
connection con1;
COUNT(*)
#
connection con2;
connection default;
DROP PROCEDURE p_show_vars;
DROP PROCEDURE p_install;
SET DEBUG_SYNC='RESET';
disconnect con1;
disconnect con2;