1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Backport BUG#41013 main.bootstrap coredumps in 6.0-rpl

When a storage engine failed to initialize before allocated slot number,
the slot number would be 0, and when later finalizing this plugin, it would
accidentally unplug the storage engine currently uses slot 0.

This patch fixed this problem by add a new macro value HA_SLOT_UNDEF to
distinguish undefined slot number from slot 0.
This commit is contained in:
He Zhenxing
2009-10-02 13:59:42 +08:00
parent 737910fb11
commit ebca60c1ff
2 changed files with 15 additions and 1 deletions

View File

@ -413,7 +413,13 @@ int ha_finalize_handlerton(st_plugin_int *plugin)
reuse an array slot. Otherwise the number of uninstall/install
cycles would be limited.
*/
hton2plugin[hton->slot]= NULL;
if (hton->slot != HA_SLOT_UNDEF)
{
/* Make sure we are not unpluging another plugin */
DBUG_ASSERT(hton2plugin[hton->slot] == plugin);
DBUG_ASSERT(hton->slot < MAX_HA);
hton2plugin[hton->slot]= NULL;
}
my_free((uchar*)hton, MYF(0));
@ -438,6 +444,7 @@ int ha_initialize_handlerton(st_plugin_int *plugin)
goto err_no_hton_memory;
}
hton->slot= HA_SLOT_UNDEF;
/* Historical Requirement */
plugin->data= hton; // shortcut for the future
if (plugin->plugin->init && plugin->plugin->init(hton))