diff options
Diffstat (limited to 'mysql-test/t/user_var.test')
-rw-r--r-- | mysql-test/t/user_var.test | 48 |
1 files changed, 41 insertions, 7 deletions
diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test index c6930a7e468..2c889c2cc0c 100644 --- a/mysql-test/t/user_var.test +++ b/mysql-test/t/user_var.test @@ -364,7 +364,7 @@ SELECT (@v:=a) <> (@v:=1) FROM t1; DROP TABLE t1; # -# LP BUG#1001506 Crash on a query with GROUP BY and user variables +# lp:1001506 Crash on a query with GROUP BY and user variables # MySQL Bug #11764372 57197: EVEN MORE USER VARIABLE CRASHING FUN # @@ -374,15 +374,49 @@ SELECT DISTINCT @a:=MIN(t1.a) FROM t1, t1 AS t2 GROUP BY @b:=(SELECT COUNT(*) > t2.a); DROP TABLE t1; +# +# +# Bug #12408412: GROUP_CONCAT + ORDER BY + INPUT/OUTPUT +# SAME USER VARIABLE = CRASH +# +SET @bug12408412=1; +SELECT GROUP_CONCAT(@bug12408412 ORDER BY 1) INTO @bug12408412; + --echo End of 5.1 tests # -# Bug#50511: Sometimes wrong handling of user variables containing NULL. +# MDEV-616 lp:1002126 +# Bug #11764371 57196: MORE FUN WITH ASSERTION: !TABLE->FILE || +# TABLE->FILE->INITED == HANDLER:: # ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings +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; +SELECT @a; +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; +SELECT @var; +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; +SELECT @a; +DROP TABLE t1; + +--echo End of 5.2 tests + +# +# Bug#50511: Sometimes wrong handling of user variables containing NULL. +# CREATE TABLE t1(f1 INT AUTO_INCREMENT, PRIMARY KEY(f1)); @@ -415,7 +449,6 @@ SELECT f1, f2 FROM t1 ORDER BY f2; DROP TRIGGER trg1; DROP TABLE t1; - --echo # --echo # Bug #12408412: GROUP_CONCAT + ORDER BY + INPUT/OUTPUT --echo # SAME USER VARIABLE = CRASH @@ -452,6 +485,8 @@ SELECT DISTINCT POW(COUNT(distinct a), @a:=(SELECT 1 FROM t1 LEFT JOIN t1 AS t2 SELECT @a; DROP TABLE t1; +--echo End of 5.5 tests + --echo # --echo # Check that used memory extends if we set a variable --echo # @@ -466,4 +501,3 @@ eval select $tmp < $tmp2; --enable_column_names --enable_query_log ---echo End of 5.5 tests |