1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fix for bug#42009: SELECT into variable gives different results to direct SELECT

Problem: storing "SELECT ... INTO @var ..." results in variables we used val_xxx()
methods which returned results of the current row. 
So, in some cases (e.g. SELECT DISTINCT, GROUP BY or HAVING) we got data
from the first row of a new group (where we evaluate a clause) instead of
data from the last row of the previous group.

Fix: use val_xxx_result() counterparts to get proper results.
This commit is contained in:
Ramil Kalimullin
2009-05-10 20:50:14 +05:00
6 changed files with 64 additions and 5 deletions

View File

@ -2052,7 +2052,7 @@ bool select_dumpvar::send_data(List<Item> &items)
{
Item_func_set_user_var *suv= new Item_func_set_user_var(mv->s, item);
suv->fix_fields(thd, 0);
suv->check(0);
suv->save_item_result(item);
suv->update();
}
}