#At file:///data0/my/darnaut/mysql-repo/work/mysql-6.0-maria/ based on revid:serg@stripped
2739 Davi Arnaut 2009-04-14
Bug#44137: Transactional DDL locking broke dynamic plugins
Allocate MDL request on the stack as the use of the table
is contained within the function. It will be removed from
the context once close_thread_tables is called at the end
of the function.
@ mysql-test/r/plugin.result
Update test case result.
@ mysql-test/t/plugin.test
Note bug report.
@ sql/sql_plugin.cc
Allocate MDL request on the stack.
modified:
mysql-test/r/plugin.result
mysql-test/t/plugin.test
sql/sql_plugin.cc
=== modified file 'mysql-test/r/plugin.result'
--- a/mysql-test/r/plugin.result 2009-04-14 12:17:34 +0000
+++ b/mysql-test/r/plugin.result 2009-04-14 16:05:26 +0000
@@ -53,6 +53,11 @@ select @@global.example_ulong_var;
set session sql_mode=@old_sql_mode;
set session old=bla;
ERROR HY000: Variable 'old' is a read only variable
+#
+# Bug#44137: Transactional DDL locking broke dynamic plugins
+#
+# Try to restart the server - plugin should be loaded after restart
+#
SELECT @@global.example_enum_var = 'e2';
@@global.example_enum_var = 'e2'
0
=== modified file 'mysql-test/t/plugin.test'
--- a/mysql-test/t/plugin.test 2009-04-14 12:17:34 +0000
+++ b/mysql-test/t/plugin.test 2009-04-14 16:05:26 +0000
@@ -73,9 +73,12 @@ set session sql_mode=@old_sql_mode;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session old=bla;
-#
-# try to restart the server - plugin should be loaded after restart
-#
+--echo #
+--echo # Bug#44137: Transactional DDL locking broke dynamic plugins
+--echo #
+--echo # Try to restart the server - plugin should be loaded after restart
+--echo #
+
--source include/restart_mysqld.inc
SELECT @@global.example_enum_var = 'e2';
=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc 2009-04-14 12:17:34 +0000
+++ b/sql/sql_plugin.cc 2009-04-14 16:05:26 +0000
@@ -1341,6 +1341,7 @@ static void plugin_load(MEM_ROOT *tmp_ro
#ifdef EMBEDDED_LIBRARY
bool table_exists;
#endif /* EMBEDDED_LIBRARY */
+ MDL_request mdl_request;
DBUG_ENTER("plugin_load");
new_thd->thread_stack= (char*) &tables;
@@ -1352,7 +1353,8 @@ static void plugin_load(MEM_ROOT *tmp_ro
tables.alias= tables.table_name= (char*)"plugin";
tables.lock_type= TL_READ;
tables.db= new_thd->db;
- alloc_mdl_requests(&tables, tmp_root);
+ tables.mdl_request= &mdl_request;
+ mdl_request.init(0, tables.db, tables.table_name);
#ifdef EMBEDDED_LIBRARY
/*
@@ -1374,7 +1376,6 @@ static void plugin_load(MEM_ROOT *tmp_ro
"run mysql_upgrade to create it.");
goto end;
}
- new_thd->mdl_context.remove_all_requests();
table= tables.table;
init_read_record(&read_record_info, new_thd, table, NULL, 1, 0, FALSE);
table->use_all_columns();
Attachment: [text/bzr-bundle] bzr/davi.arnaut@sun.com-20090414160526-uhtipy93nrr95pnt.bundle
| Thread |
|---|
| • bzr commit into mysql-6.0 branch (Davi.Arnaut:2739) Bug#44137 | Davi Arnaut | 14 Apr |