mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Fixed the bug mdev-12673.
This patch corrects the fix for the bug mdev-10693. It is critical for the function get_best_combination() not to call create_ref_for_key() for constant tables. This bug could manifest itself only in multi-table subqueries where one of the tables is accessed by a constant primary key.
This commit is contained in:
@ -7844,12 +7844,14 @@ get_best_combination(JOIN *join)
|
||||
{
|
||||
if (j->bush_children)
|
||||
j= j->bush_children->start;
|
||||
|
||||
|
||||
used_tables|= j->table->map;
|
||||
if ((keyuse= join->best_positions[tablenr].key) &&
|
||||
create_ref_for_key(join, j, keyuse, TRUE, used_tables))
|
||||
DBUG_RETURN(TRUE); // Something went wrong
|
||||
|
||||
if (j->type != JT_CONST && j->type != JT_SYSTEM)
|
||||
{
|
||||
if ((keyuse= join->best_positions[tablenr].key) &&
|
||||
create_ref_for_key(join, j, keyuse, TRUE, used_tables))
|
||||
DBUG_RETURN(TRUE); // Something went wrong
|
||||
}
|
||||
if (j->last_leaf_in_bush)
|
||||
j= j->bush_root_tab;
|
||||
}
|
||||
|
Reference in New Issue
Block a user