1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

MCOL-4282 Follow up version 2.

Mutate the optimizer flags for prepared statements in:
  1. ha_mcs::open
  2. ha_mcs::discover_check_version

This is done to ensure the optimizer flags are disabled before
JOIN::prepare() is called during "PREPARE stmt FROM ...".
This commit is contained in:
Gagan Goel
2020-09-25 01:29:21 -04:00
parent 5646164a46
commit a1ea633a19
3 changed files with 51 additions and 2 deletions

View File

@ -47,10 +47,16 @@ void mutate_optimizer_flags(THD *thd_)
// MCOL-2178 Disable all optimizer flags as it was in the fork.
// CS restores it later in SH::scan_end() and in case of an error
// in SH::scan_init()
set_original_optimizer_flags(thd_->variables.optimizer_switch, thd_);
thd_->variables.optimizer_switch = OPTIMIZER_SWITCH_IN_TO_EXISTS |
ulonglong flags_to_set = OPTIMIZER_SWITCH_IN_TO_EXISTS |
OPTIMIZER_SWITCH_COND_PUSHDOWN_FOR_DERIVED |
OPTIMIZER_SWITCH_COND_PUSHDOWN_FROM_HAVING;
if (thd_->variables.optimizer_switch == flags_to_set)
return;
set_original_optimizer_flags(thd_->variables.optimizer_switch, thd_);
thd_->variables.optimizer_switch = flags_to_set;
}
void restore_optimizer_flags(THD *thd_)