summaryrefslogtreecommitdiff
path: root/mysql-test/r/user_var.result
diff options
context:
space:
mode:
authorunknown <sanja@montyprogram.com>2012-10-09 17:36:02 +0300
committerunknown <sanja@montyprogram.com>2012-10-09 17:36:02 +0300
commit4304dbc464d425e54b0d802568838592cb625b26 (patch)
treedd9046c5f97ecbd9ec2ccd85811fbc5273a7bb08 /mysql-test/r/user_var.result
parent72ab07c1cba0565a8ef043931610a2510a85cfd5 (diff)
downloadmariadb-git-4304dbc464d425e54b0d802568838592cb625b26.tar.gz
MDEV-616 fix (MySQL fix accepted)
Diffstat (limited to 'mysql-test/r/user_var.result')
-rw-r--r--mysql-test/r/user_var.result38
1 files changed, 35 insertions, 3 deletions
diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result
index 19cb54ad2bc..fbbe6d1839e 100644
--- a/mysql-test/r/user_var.result
+++ b/mysql-test/r/user_var.result
@@ -348,10 +348,10 @@ select @a:=f3, count(f3) from t1 group by 1 desc;
1.5 4
select @a:=f4, count(f4) from t1 group by 1 desc;
@a:=f4 count(f4)
-4.6 1
-3.6 2
-2.6 1
1.6 4
+1.6 1
+1.6 2
+1.6 1
drop table t1;
create table t1 (f1 int);
insert into t1 values (2), (1);
@@ -464,3 +464,35 @@ GROUP BY @b:=(SELECT COUNT(*) > t2.a);
1
DROP TABLE t1;
End of 5.1 tests
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (0);
+SELECT DISTINCT POW(COUNT(*), @a:=(SELECT 1 FROM t1 LEFT JOIN t1 AS t2 ON @a))
+AS b FROM t1 GROUP BY a;
+b
+1
+SELECT @a;
+@a
+1
+DROP TABLE t1;
+CREATE TABLE t1(f1 INT, f2 INT);
+INSERT INTO t1 VALUES (1,2),(2,3),(3,1);
+CREATE TABLE t2(a INT);
+INSERT INTO t2 VALUES (1);
+SET @var=NULL;
+SELECT @var:=(SELECT f2 FROM t2 WHERE @var) FROM t1 GROUP BY f1 ORDER BY f2 DESC
+LIMIT 1;
+@var:=(SELECT f2 FROM t2 WHERE @var)
+NULL
+SELECT @var;
+@var
+NULL
+DROP TABLE t1, t2;
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (0),(1),(3);
+SELECT DISTINCT POW(COUNT(distinct a), @a:=(SELECT 1 FROM t1 LEFT JOIN t1 AS t2 ON @a limit 1)) AS b FROM t1 GROUP BY a;
+b
+1
+SELECT @a;
+@a
+1
+DROP TABLE t1;