Commit 337c1b3e authored by Sergei Golubchik's avatar Sergei Golubchik

fix plugin locking/unlocking when assisted discovery fails

parent faf4d99d
...@@ -4420,6 +4420,16 @@ bool mysql_create_table_no_lock(THD *thd, ...@@ -4420,6 +4420,16 @@ bool mysql_create_table_no_lock(THD *thd,
goto err; goto err;
ha_err= hton->discover_table_structure(hton, thd, &share, create_info); ha_err= hton->discover_table_structure(hton, thd, &share, create_info);
/*
if discovery failed, the plugin will be auto-unlocked, as it
was locked on the THD, see above.
if discovery succeeded, the plugin was replaced by a globally
locked plugin, that will be unlocked by free_table_share()
*/
if (ha_err)
share.db_plugin= 0; // will be auto-freed, locked above on the THD
free_table_share(&share); free_table_share(&share);
if (ha_err) if (ha_err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment