diff options
author | Ramil Kalimullin <ramil@mysql.com> | 2009-02-24 18:47:12 +0400 |
---|---|---|
committer | Ramil Kalimullin <ramil@mysql.com> | 2009-02-24 18:47:12 +0400 |
commit | bd414485de627818a8fd28fc00887d919d4e0ae1 (patch) | |
tree | 098b599994037a5e7609851889db9e3952582d54 /sql/sql_class.cc | |
parent | fb20a7d6d0b21d69ff0941f3c0c57c1ae24fbbef (diff) | |
download | mariadb-git-bd414485de627818a8fd28fc00887d919d4e0ae1.tar.gz |
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.
mysql-test/r/distinct.result:
Fix for bug#42009: SELECT into variable gives different results to direct SELECT
- results adjusted.
mysql-test/r/user_var.result:
Fix for bug#42009: SELECT into variable gives different results to direct SELECT
- test result.
mysql-test/t/user_var.test:
Fix for bug#42009: SELECT into variable gives different results to direct SELECT
- test case.
sql/item_func.cc:
Fix for bug#42009: SELECT into variable gives different results to direct SELECT
- Item_func_set_user_var::save_item_result() added to evaluate and store
an item's result into a user variable.
sql/item_func.h:
Fix for bug#42009: SELECT into variable gives different results to direct SELECT
- Item_func_set_user_var::save_item_result() added to evaluate and store
an item's result into a user variable.
sql/sql_class.cc:
Fix for bug#42009: SELECT into variable gives different results to direct SELECT
- use Item_func_set_user_var::save_item_result() to store results into user
variables.
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r-- | sql/sql_class.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 9ff602bb62e..a95003d440b 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -2041,7 +2041,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(); } } |