BKA join cache buffer is employed despite join_cache_level=3 (flat BNLH)

In the `check_join_cache_usage()` function there is a branching issue
where an accidental fall-through to BKA/BKAH buffers may occur, even
when the join_cache_level setting does not permit their use.

This patch corrects the condition to ensure that BKA/BKAH join caching
is only enabled when explicitly allowed by join_cache_level

Reviewer: Sergei Petrunia <sergey@mariadb.com>
This commit is contained in:
Oleg Smirnov 2025-02-26 17:57:43 +07:00
commit 733852d4c3
3 changed files with 54 additions and 1 deletions

View file

@ -14769,7 +14769,7 @@ uint check_join_cache_usage(JOIN_TAB *tab,
}
goto no_join_cache;
}
if (cache_level > 4 && no_bka_cache)
if (cache_level < 5 || no_bka_cache)
goto no_join_cache;
if ((flags & HA_MRR_NO_ASSOCIATION) &&