diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-07-15 10:17:15 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-07-15 10:17:15 +0300 |
commit | 9936cfd531a49b0ba124c4eb38a6099ec420c7fd (patch) | |
tree | 52e3c6dd19846b7ff0d895c31e78bc1e781ca780 /sql/sys_vars.cc | |
parent | a7634281aa64a549d19cd20ead7e80d0267271ee (diff) | |
parent | 8a0944080c950349aaf7c81bc8f8c63b262f98eb (diff) | |
download | mariadb-git-9936cfd531a49b0ba124c4eb38a6099ec420c7fd.tar.gz |
Merge 10.3 into 10.4
Diffstat (limited to 'sql/sys_vars.cc')
-rw-r--r-- | sql/sys_vars.cc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 1ed445c8d0b..e46925f5ee0 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2002, 2015, Oracle and/or its affiliates. - Copyright (c) 2012, 2018, MariaDB Corporation. + Copyright (c) 2012, 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -2612,12 +2612,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(0), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_legal_optimizer_switch), ON_UPDATE(fix_optimizer_switch)); static Sys_var_flagset Sys_optimizer_trace( |