Bug #44137 Metadata locking broke dynamic plugins
Submitted: 7 Apr 2009 20:38 Modified: 26 Apr 2009 22:31
Reporter: Sergei Golubchik Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: User-defined functions ( UDF ) Severity:S1 (Critical)
Version:6.0 OS:Any
Assigned to: Davi Arnaut
Triage: Triaged: D1 (Critical) / R2 (Low) / E1 (None/Negligible)

[7 Apr 2009 20:38] Sergei Golubchik
Description:
after transactional ddl locking patch auto-loading of dynamic plugins from mysql.plugin table on startup doesn't work - the server crashes at once

How to repeat:
build with safemalloc, install a plugin, restart the server.

Suggested fix:
don't allocale mdl locks in a memory root that is cleared in the inner loop
[7 Apr 2009 21:29] Davi Arnaut
I guess you are referring to allocating the MDL lock requests in the tmp_root in function plugin_load. Hum, that has been there for quite some time and indeed, it's buggy. Now I wonder why it started crashing with transactional DDL locking.. do you happen to have more then one entry in mysql.plugin?
[8 Apr 2009 6:22] Sergei Golubchik
No, only one
[14 Apr 2009 12:18] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/72000

2736 Sergei Golubchik	2009-04-14
      Bug #44137 Transactional DDL locking broke dynamic plugins
      remove all mdl lock requests from the memory root before
      it's reset in the read_record loop
[14 Apr 2009 16:13] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/72030

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.
[14 Apr 2009 21:29] Davi Arnaut
Pushed to 6.0-maria
[14 Apr 2009 22:45] Davi Arnaut
Bug#40935 has been marked as a duplicate of this bug.
[14 Apr 2009 22:56] Davi Arnaut
This bug was reported after Bug#40935 and the problem exists even before transactional DDL locking was pushed to the main tree. But since the this one is already pushed, the other has been closed as a duplicate.
[23 Apr 2009 7:18] Bugs System
Pushed into 6.0.11-alpha (revid:alik@sun.com-20090423070920-e5lq3vrrqi016z2c) (version source revid:alik@sun.com-20090423070920-e5lq3vrrqi016z2c) (merge vers: 6.0.11-alpha) (pib:6)
[26 Apr 2009 22:31] Paul Dubois
Noted in 6.0.11 changelog.

The server could crash at startup when initializing
plugins listed in the plugin table.