1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Problem was that for cases like:

SELECT ... WHERE XX IN (SELECT YY)
this was transformed to something like:
SELECT ... WHERE IF_EXISTS(SELECT ... HAVING XX=YY)

The bug was that for normal execution XX was fixed in the original outer SELECT context while in PS it was fixed in the sub query context and this confused the optimizer.

Fixed by ensuring that XX is always fixed in the outer context.
This commit is contained in:
Monty
2015-06-25 23:26:29 +03:00
parent 2e941fe9fc
commit 8c815751c9
6 changed files with 102 additions and 9 deletions

View File

@ -6859,6 +6859,7 @@ find_field_in_tables(THD *thd, Item_ident *item,
if (item->cached_table)
{
DBUG_PRINT("info", ("using cached table"));
/*
This shortcut is used by prepared statements. We assume that
TABLE_LIST *first_table is not changed during query execution (which
@ -6935,8 +6936,6 @@ find_field_in_tables(THD *thd, Item_ident *item,
return found;
}
}
else
item->can_be_depended= TRUE;
if (db && lower_case_table_names)
{