1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-32064 Crash when searching for the best split of derived table

This bug could affect queries with IN subqueries in WHERE clause and using
derived tables to which split optimization potentially could be applied.

When looking for the best split of a splittable derived table T any key
access from a semi-join materialized table used for lookups S to table T
must be excluded from consideration because in the current implementation
of such tables as S the values from its records cannot be used to access
other tables.

Approved by Oleksandr Byelkin <sanja@mariadb.com>
This commit is contained in:
Igor Babaev
2023-10-11 22:46:36 -07:00
parent 0ca699bff7
commit b1c8ea83a5
3 changed files with 206 additions and 1 deletions

View File

@@ -987,7 +987,8 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(uint idx,
table_map needed_in_prefix= 0;
do
{
if (keyuse_ext->needed_in_prefix & remaining_tables)
if (keyuse_ext->needed_in_prefix &
(remaining_tables | this->join->sjm_lookup_tables))
{
keyuse_ext++;
continue;