Hi, Sergey!
On Oct 17, Sergey Glukhov wrote:
> #At file:///home/gluh/MySQL/mysql-5.1-bug-29263/
>
> 2759 Sergey Glukhov 2008-10-17
> Bug#29263 disabled storage engines omitted in SHOW ENGINES
> Static disabled plugins|engines and dynamic plugins which
> installed but disabled are not visible in I_S PLUGINS|ENGINES
> tables because they are not stored into global plugin array.
> The fix: add such plugins|engines to plugin array with
> PLUGIN_IS_DISABLED status. I_S.ENGINES 'Transactions', 'XA',
> 'Savepoints' fields have NULL value in this case.
Ok to push after fixing as I commented below and adding a test case.
> === modified file 'sql/sql_plugin.cc'
> --- a/sql/sql_plugin.cc 2008-08-19 15:35:56 +0000
> +++ b/sql/sql_plugin.cc 2008-10-17 08:29:35 +0000
> @@ -1247,6 +1249,7 @@ static bool register_builtin(struct st_m
> {
> DBUG_ENTER("register_builtin");
>
> + if (tmp->state != PLUGIN_IS_DISABLED)
> tmp->state= PLUGIN_IS_UNINITIALIZED;
better say that the caller needs to initialize the state.
And before calling register_builtin() set the state to
PLUGIN_IS_DISABLED or PLUGIN_IS_UNINITIALIZED.
> tmp->ref_count= 0;
> tmp->plugin_dl= 0;
> === modified file 'sql/sql_show.cc'
> --- a/sql/sql_show.cc 2008-10-02 10:08:15 +0000
> +++ b/sql/sql_show.cc 2008-10-17 08:29:35 +0000
> @@ -3885,10 +3907,13 @@ static my_bool iter_schema_engines(THD *
> strlen(plugin_decl(plugin)->descr), scs);
> tmp= &yesno[test(hton->commit)];
> table->field[3]->store(tmp->str, tmp->length, scs);
> + table->field[3]->set_notnull();
> tmp= &yesno[test(hton->prepare)];
> table->field[4]->store(tmp->str, tmp->length, scs);
> + table->field[4]->set_notnull();
> tmp= &yesno[test(hton->savepoint_set)];
> table->field[5]->store(tmp->str, tmp->length, scs);
> + table->field[5]->set_notnull();
>
> if (schema_table_store_record(thd, table))
> DBUG_RETURN(1);
> @@ -3899,8 +3924,12 @@ static my_bool iter_schema_engines(THD *
>
> int fill_schema_engines(THD *thd, TABLE_LIST *tables, COND *cond)
> {
> - return plugin_foreach(thd, iter_schema_engines,
> - MYSQL_STORAGE_ENGINE_PLUGIN, tables->table);
> + DBUG_ENTER("fill_schema_engines");
> + if (plugin_foreach_with_mask(thd, iter_schema_engines,
> + MYSQL_STORAGE_ENGINE_PLUGIN,
> + ~PLUGIN_IS_FREED, tables->table))
hm. It was using the mask PLUGIN_IS_READY, now you use, de facto,
PLUGIN_IS_DELETED | PLUGIN_IS_UNINITIALIZED |
PLUGIN_IS_READY | PLUGIN_IS_DYING | PLUGIN_IS_DISABLED
May be you'd better use (PLUGIN_IS_READY | PLUGIN_IS_DISABLED) ?
Or, perhaps, use the ~PLUGIN_IS_FREED mask but instead of
+ if (!hton)
do
+ if (plugin_state(plugin) != PLUGIN_IS_READY)
that is showing everything which isn't ready as disabled.
> + DBUG_RETURN(1);
> + DBUG_RETURN(0);
> }
>
>
Regards / Mit vielen Grüßen,
Sergei
--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Sergei Golubchik <serg@stripped>
/ /|_/ / // /\ \/ /_/ / /__ Principal Software Engineer/Server Architect
/_/ /_/\_, /___/\___\_\___/ Sun Microsystems GmbH, HRB München 161028
<___/ Sonnenallee 1, 85551 Kirchheim-Heimstetten
Geschäftsführer: Thomas Schroeder, Wolfgang Engels, Dr. Roland Boemer
Vorsitzender des Aufsichtsrates: Martin Häring