diff options
Diffstat (limited to 'mysql-test/r/user_var.result')
-rw-r--r-- | mysql-test/r/user_var.result | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result index e98dda46061..9c4fd02fcdd 100644 --- a/mysql-test/r/user_var.result +++ b/mysql-test/r/user_var.result @@ -498,4 +498,36 @@ DROP TABLE t1; # SET @bug12408412=1; SELECT GROUP_CONCAT(@bug12408412 ORDER BY 1) INTO @bug12408412; +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; End of 5.5 tests |