diff options
author | Ramil Kalimullin <ramil@mysql.com> | 2009-05-10 20:50:14 +0500 |
---|---|---|
committer | Ramil Kalimullin <ramil@mysql.com> | 2009-05-10 20:50:14 +0500 |
commit | d615a11bd5d3572f51c6341c02338e7c742e29c0 (patch) | |
tree | e3691f3d67aac716b17f30550912ecf4781784aa /sql/item_func.h | |
parent | f68ae2f514d171012ab4a59b643c039f148dd4a8 (diff) | |
parent | bd414485de627818a8fd28fc00887d919d4e0ae1 (diff) | |
download | mariadb-git-d615a11bd5d3572f51c6341c02338e7c742e29c0.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/item_func.h')
-rw-r--r-- | sql/item_func.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/item_func.h b/sql/item_func.h index 7e15a536cf2..33aeddfe6e6 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -1308,6 +1308,7 @@ public: bool send(Protocol *protocol, String *str_arg); void make_field(Send_field *tmp_field); bool check(bool use_result_field); + void save_item_result(Item *item); bool update(); enum Item_result result_type () const { return cached_result_type; } bool fix_fields(THD *thd, Item **ref); |