summaryrefslogtreecommitdiff
path: root/mysql-test/t/user_var.test
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2007-06-02 23:17:46 +0400
committerunknown <evgen@moonbone.local>2007-06-02 23:17:46 +0400
commit8ab1830f9a4cca12420e2cd9756983707bca9af2 (patch)
tree3771e6cad6d39e81d3411a15dceb66569ee03172 /mysql-test/t/user_var.test
parent865f294fcfe14bf69a85eb8ba1260b7a4af45d7d (diff)
downloadmariadb-git-8ab1830f9a4cca12420e2cd9756983707bca9af2.tar.gz
Bug#28494: Grouping by Item_func_set_user_var produces incorrect result.
This is an additional fix. Item::val_xxx methods are supposed to use original data source and Item::val_xxx_result methods to use the item's result field. But for the Item_func_set_user_var class val_xxx_result methods were mapped to val_xxx methods. This leads, in particular, to producing bad sort keys and thus wrong order of the result set of queries with group by/order by clauses. The set of val_xxx_result methods is added to the Item_func_set_user_var class. It's the same as the val_xxx set of method but uses the result_field to return a value. mysql-test/t/user_var.test: Corrected test case for hte bug#28494. mysql-test/r/user_var.result: Corrected test case for hte bug#28494. sql/item_func.cc: Bug#28494: Grouping by Item_func_set_user_var produces incorrect result. The set of val_xxx_result methods is added to the Item_func_set_user_var class. It's the same as the val_xxx set of method but uses the result_field to return a value. sql/item_func.h: Bug#28494: Grouping by Item_func_set_user_var produces incorrect result. The set of val_xxx_result methods is added to the Item_func_set_user_var class.
Diffstat (limited to 'mysql-test/t/user_var.test')
-rw-r--r--mysql-test/t/user_var.test5
1 files changed, 3 insertions, 2 deletions
diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test
index 7919b663a73..3df949ae669 100644
--- a/mysql-test/t/user_var.test
+++ b/mysql-test/t/user_var.test
@@ -227,6 +227,7 @@ SHOW COUNT(*) ERRORS;
# Bug#28494: Grouping by Item_func_set_user_var produces incorrect result.
#
create table t1(f1 int);
-insert into t1 values(1),(1),(2);
-select @a:=f1, count(f1) from t1 group by 1;
+insert into t1 values(1),(1),(2),(3),(4),(1),(3),(1);
+select @a:=f1, count(f1) from t1 group by 1 desc;
+select @a:=f1, count(f1) from t1 group by 1 asc;
drop table t1;