mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
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
This commit is contained in:
parent
94ecd2314d
commit
b7ea563491
2 changed files with 7 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue