summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/user_var.result14
-rw-r--r--mysql-test/t/user_var.test5
2 files changed, 14 insertions, 5 deletions
diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result
index b9f58b60d9b..b90bb1f062b 100644
--- a/mysql-test/r/user_var.result
+++ b/mysql-test/r/user_var.result
@@ -318,9 +318,17 @@ SHOW COUNT(*) ERRORS;
@@session.error_count
1
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;
@a:=f1 count(f1)
-1 2
+4 1
+3 2
2 1
+1 4
+select @a:=f1, count(f1) from t1 group by 1 asc;
+@a:=f1 count(f1)
+1 4
+2 1
+3 2
+4 1
drop table t1;
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;