1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-14689 Server crashes in find_field_in_tables on 2nd execution of PS with versioned table and view

SQL: wrong usage of Item::transform()
This commit is contained in:
Eugene Kosov
2017-12-21 14:59:46 +03:00
committed by GitHub
parent 6dc75b5f89
commit aa4d1bedfc
3 changed files with 36 additions and 6 deletions

View File

@ -700,24 +700,36 @@ void JOIN::vers_check_items()
if (conds)
{
conds= conds->transform(thd, transformer, NULL);
Item *tmp = conds->transform(thd, transformer, NULL);
if (conds != tmp)
conds= tmp;
}
for (ORDER *ord= order; ord; ord= ord->next)
{
ord->item_ptr= (*ord->item)->transform(thd, transformer, NULL);
*ord->item= ord->item_ptr;
Item *tmp= (*ord->item)->transform(thd, transformer, NULL);
if (*ord->item != tmp)
{
ord->item_ptr= tmp;
*ord->item= ord->item_ptr;
}
}
for (ORDER *ord= group_list; ord; ord= ord->next)
{
ord->item_ptr= (*ord->item)->transform(thd, transformer, NULL);
*ord->item= ord->item_ptr;
Item *tmp= (*ord->item)->transform(thd, transformer, NULL);
if (*ord->item != tmp)
{
ord->item_ptr= tmp;
*ord->item= ord->item_ptr;
}
}
if (having)
{
having= having->transform(thd, transformer, NULL);
Item *tmp= having->transform(thd, transformer, NULL);
if (having != tmp)
having= tmp;
}
}