Commit b7ea5634 authored by Alexander Barkov's avatar Alexander Barkov

Cleanup in the system variable parsing code

- Adding "return true" into LEX::set_system_variable()
  and LEX::set_default_system_variable() after my_error().
  This makes the parser exit on error immediately.
  Previously, the error was caught only in mysql_parser(),
  a few lines after the parse_sql() call.
- Fixing "--error 1272" to "--error ER_VARIABLE_IS_NOT_STRUCT" in tests
parent 94ecd231
......@@ -44,7 +44,7 @@ SET @@global.key_buffer_size=@save_key_buffer_size;
--error 1064
SELECT @@default.key_buffer_size;
--error 1272
--error ER_VARIABLE_IS_NOT_STRUCT
SELECT @@skr.storage_engine="test";
select @@keycache1.key_cache_block_size;
......
......@@ -7011,7 +7011,10 @@ bool LEX::set_default_system_variable(enum_var_type var_type,
if (!var)
return true;
if (!var->is_struct())
{
my_error(ER_VARIABLE_IS_NOT_STRUCT, MYF(0), name->str);
return true;
}
return set_system_variable(var_type, var, &default_base_name, val);
}
......@@ -7040,7 +7043,10 @@ bool LEX::set_system_variable(THD *thd, enum_var_type var_type,
return true;
}
if (!tmp->is_struct())
{
my_error(ER_VARIABLE_IS_NOT_STRUCT, MYF(0), name2->str);
return true;
}
return set_system_variable(var_type, tmp, name1, val);
}
......
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