mirror of
https://github.com/MariaDB/server.git
synced 2026-05-13 18:40:48 +02:00
Fixed the bug mdev-12838.
If the optimizer chose an execution plan where a semi-join nest were materialized and the result of materialization was scanned to access other tables by ref access it could build a key over columns of the tables from the nest that were actually inaccessible. The patch performs a proper check whether a key that uses columns of the tables from a materialized semi-join nest can be employed to access outer tables.
This commit is contained in:
parent
2cb94aa1b7
commit
c258ca2463
6 changed files with 461 additions and 5 deletions
|
|
@ -540,6 +540,8 @@ typedef struct st_join_table {
|
|||
!(used_sjm_lookup_tables & ~emb_sj_nest->sj_inner_tables));
|
||||
}
|
||||
|
||||
bool keyuse_is_valid_for_access_in_chosen_plan(JOIN *join, KEYUSE *keyuse);
|
||||
|
||||
} JOIN_TAB;
|
||||
|
||||
|
||||
|
|
@ -1003,6 +1005,11 @@ public:
|
|||
to materialize and access by lookups
|
||||
*/
|
||||
table_map sjm_lookup_tables;
|
||||
/**
|
||||
Bitmap of semijoin tables that the chosen plan decided
|
||||
to materialize to scan the results of materialization
|
||||
*/
|
||||
table_map sjm_scan_tables;
|
||||
/*
|
||||
Constant tables for which we have found a row (as opposed to those for
|
||||
which we didn't).
|
||||
|
|
@ -1331,6 +1338,7 @@ public:
|
|||
pre_sort_join_tab= NULL;
|
||||
emb_sjm_nest= NULL;
|
||||
sjm_lookup_tables= 0;
|
||||
sjm_scan_tables= 0;
|
||||
/*
|
||||
The following is needed because JOIN::cleanup(true) may be called for
|
||||
joins for which JOIN::optimize was aborted with an error before a proper
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue