summaryrefslogtreecommitdiff
path: root/mysql-test/main/sp.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/main/sp.result')
-rw-r--r--mysql-test/main/sp.result28
1 files changed, 28 insertions, 0 deletions
diff --git a/mysql-test/main/sp.result b/mysql-test/main/sp.result
index 64caf0fd554..4315cc60925 100644
--- a/mysql-test/main/sp.result
+++ b/mysql-test/main/sp.result
@@ -8356,6 +8356,34 @@ CREATE PROCEDURE foo ( IN i INT UNSIGNED ) BEGIN END;
CALL foo( LAST_INSERT_ID() );
DROP PROCEDURE foo;
#
+# MDEV-15870 Using aggregate and window function in unexpected places can crash the server
+#
+CREATE PROCEDURE p1 (a TEXT) BEGIN END;
+CALL p1(RANK() OVER (ORDER BY 1));
+ERROR HY000: Window function is allowed only in SELECT list and ORDER BY clause
+CALL p1(ROW_NUMBER() OVER ());
+ERROR HY000: Window function is allowed only in SELECT list and ORDER BY clause
+CALL p1(SUM(1));
+ERROR HY000: Invalid use of group function
+DROP PROCEDURE p1;
+#
+# MDEV-16311 Server crash when using a NAME_CONST() with a CURSOR
+#
+SET sql_mode=STRICT_ALL_TABLES;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (10);
+BEGIN NOT ATOMIC
+DECLARE a INT;
+DECLARE c CURSOR FOR SELECT NAME_CONST('x','y') FROM t1;
+OPEN c;
+FETCH c INTO a;
+CLOSE c;
+END;
+$$
+ERROR 22007: Incorrect integer value: 'y' for column 'a' at row 1
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+#
# Start of 10.3 tests
#
#