mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
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.
This commit is contained in:
@ -124,6 +124,9 @@ static my_bool show_plugins(THD *thd, plugin_ref plugin,
|
||||
case PLUGIN_IS_READY:
|
||||
table->field[2]->store(STRING_WITH_LEN("ACTIVE"), cs);
|
||||
break;
|
||||
case PLUGIN_IS_DISABLED:
|
||||
table->field[2]->store(STRING_WITH_LEN("DISABLED"), cs);
|
||||
break;
|
||||
default:
|
||||
DBUG_ASSERT(0);
|
||||
}
|
||||
@ -3930,6 +3933,25 @@ static my_bool iter_schema_engines(THD *thd, plugin_ref plugin,
|
||||
handlerton *default_type= ha_default_handlerton(thd);
|
||||
DBUG_ENTER("iter_schema_engines");
|
||||
|
||||
|
||||
/* Disabled plugins */
|
||||
if (plugin_state(plugin) != PLUGIN_IS_READY)
|
||||
{
|
||||
|
||||
struct st_mysql_plugin *plug= plugin_decl(plugin);
|
||||
if (!(wild && wild[0] &&
|
||||
wild_case_compare(scs, plug->name,wild)))
|
||||
{
|
||||
restore_record(table, s->default_values);
|
||||
table->field[0]->store(plug->name, strlen(plug->name), scs);
|
||||
table->field[1]->store(C_STRING_WITH_LEN("NO"), scs);
|
||||
table->field[2]->store(plug->descr, strlen(plug->descr), scs);
|
||||
if (schema_table_store_record(thd, table))
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
if (!(hton->flags & HTON_HIDDEN))
|
||||
{
|
||||
LEX_STRING *name= plugin_name(plugin);
|
||||
@ -3950,10 +3972,13 @@ static my_bool iter_schema_engines(THD *thd, plugin_ref plugin,
|
||||
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);
|
||||
@ -3964,8 +3989,12 @@ static my_bool iter_schema_engines(THD *thd, plugin_ref plugin,
|
||||
|
||||
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))
|
||||
DBUG_RETURN(1);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
||||
@ -6162,9 +6191,9 @@ ST_FIELD_INFO engines_fields_info[]=
|
||||
{"ENGINE", 64, MYSQL_TYPE_STRING, 0, 0, "Engine", SKIP_OPEN_TABLE},
|
||||
{"SUPPORT", 8, MYSQL_TYPE_STRING, 0, 0, "Support", SKIP_OPEN_TABLE},
|
||||
{"COMMENT", 80, MYSQL_TYPE_STRING, 0, 0, "Comment", SKIP_OPEN_TABLE},
|
||||
{"TRANSACTIONS", 3, MYSQL_TYPE_STRING, 0, 0, "Transactions", SKIP_OPEN_TABLE},
|
||||
{"XA", 3, MYSQL_TYPE_STRING, 0, 0, "XA", SKIP_OPEN_TABLE},
|
||||
{"SAVEPOINTS", 3 ,MYSQL_TYPE_STRING, 0, 0, "Savepoints", SKIP_OPEN_TABLE},
|
||||
{"TRANSACTIONS", 3, MYSQL_TYPE_STRING, 0, 1, "Transactions", SKIP_OPEN_TABLE},
|
||||
{"XA", 3, MYSQL_TYPE_STRING, 0, 1, "XA", SKIP_OPEN_TABLE},
|
||||
{"SAVEPOINTS", 3 ,MYSQL_TYPE_STRING, 0, 1, "Savepoints", SKIP_OPEN_TABLE},
|
||||
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user