mirror of
https://github.com/MariaDB/server.git
synced 2025-08-05 13:16:09 +03:00
Bug#6481 - storage_engine system variable allows nonsensical value
Check that the requested storage engine is enabled.
This commit is contained in:
@@ -2945,9 +2945,11 @@ bool sys_var_thd_storage_engine::check(THD *thd, set_var *var)
|
|||||||
|
|
||||||
if (var->value->result_type() == STRING_RESULT)
|
if (var->value->result_type() == STRING_RESULT)
|
||||||
{
|
{
|
||||||
|
enum db_type db_type;
|
||||||
if (!(res=var->value->val_str(&str)) ||
|
if (!(res=var->value->val_str(&str)) ||
|
||||||
!(var->save_result.ulong_value=
|
!(var->save_result.ulong_value=
|
||||||
(ulong) ha_resolve_by_name(res->ptr(), res->length())))
|
(ulong) db_type= ha_resolve_by_name(res->ptr(), res->length())) ||
|
||||||
|
ha_checktype(db_type) != db_type)
|
||||||
{
|
{
|
||||||
value= res ? res->c_ptr() : "NULL";
|
value= res ? res->c_ptr() : "NULL";
|
||||||
goto err;
|
goto err;
|
||||||
|
Reference in New Issue
Block a user