diff options
author | Rucha Deodhar <rucha.deodhar@mariadb.com> | 2020-07-02 19:03:39 +0530 |
---|---|---|
committer | Rucha Deodhar <rucha.deodhar@mariadb.com> | 2020-07-12 20:03:32 +0530 |
commit | 0994af43e582fccf55f7893b16228b57e92330d0 (patch) | |
tree | 7d977bcd4d8a7565cc62267ee2862690f17e1063 /sql/sys_vars.cc | |
parent | f81ff93287349daeb62c46e699ac54996a09860b (diff) | |
download | mariadb-git-0994af43e582fccf55f7893b16228b57e92330d0.tar.gz |
MDEV-22058: Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed in Diagnostics_area::set_ok_status
Error state is not stored in check_and_do_in_subquery_rewrites() when there is
illegal combination of optimizer switches. So all the functions eventually
return false. Thus the assetion failure.
Diffstat (limited to 'sql/sys_vars.cc')
-rw-r--r-- | sql/sys_vars.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 2d40943827f..af261299496 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -2471,12 +2471,23 @@ static bool fix_optimizer_switch(sys_var *self, THD *thd, "engine_condition_pushdown=on"); return false; } +static bool check_legal_optimizer_switch(sys_var *self, THD *thd, + set_var *var) +{ + if (var->save_result.ulonglong_value & (OPTIMIZER_SWITCH_MATERIALIZATION | + OPTIMIZER_SWITCH_IN_TO_EXISTS)) + { + return false; + } + my_error(ER_ILLEGAL_SUBQUERY_OPTIMIZER_SWITCHES, MYF(0)); + return true; +} static Sys_var_flagset Sys_optimizer_switch( "optimizer_switch", "Fine-tune the optimizer behavior", SESSION_VAR(optimizer_switch), CMD_LINE(REQUIRED_ARG), optimizer_switch_names, DEFAULT(OPTIMIZER_SWITCH_DEFAULT), - NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(NULL), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_legal_optimizer_switch), ON_UPDATE(fix_optimizer_switch)); static Sys_var_charptr Sys_pid_file( |