1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-4868 UPDATE on a ColumnStore table containing an IN-subquery

on a non-ColumnStore table does not work.

As part of MCOL-4617, we moved the in-to-exists predicate creation
and injection from the server into the engine. However, when query
with an IN Subquery contains a non-ColumnStore table, the server
still performs the in-to-exists predicate transformation for the
foreign engine table. This caused ColumnStore's execution plan to
contain incorrect WHERE predicates. As a fix, we call
mutate_optimizer_flags() for the WRITE lock, in addition to the READ
table lock. And in mutate_optimizer_flags(), we change the optimizer
flag from OPTIMIZER_SWITCH_IN_TO_EXISTS to OPTIMIZER_SWITCH_MATERIALIZATION.
This commit is contained in:
Gagan Goel
2021-12-14 19:25:03 -05:00
parent 6144e6ff99
commit 7f456e58cc
6 changed files with 209 additions and 12 deletions

View File

@ -36,7 +36,7 @@ void mutate_optimizer_flags(THD *thd_)
// CS restores it later in SH::scan_end() and in case of an error
// in SH::scan_init()
ulonglong flags_to_set = OPTIMIZER_SWITCH_IN_TO_EXISTS |
ulonglong flags_to_set = OPTIMIZER_SWITCH_MATERIALIZATION |
OPTIMIZER_SWITCH_COND_PUSHDOWN_FOR_DERIVED |
OPTIMIZER_SWITCH_COND_PUSHDOWN_FROM_HAVING;