summaryrefslogtreecommitdiff
path: root/mysql-test/t/view.test
diff options
context:
space:
mode:
authorVarun Gupta <varun.gupta@mariadb.com>2019-03-12 19:41:46 +0530
committerVarun Gupta <varun.gupta@mariadb.com>2019-03-12 19:48:16 +0530
commitfe8cf7f13142b034aef9b7f88e6260340c6ac37d (patch)
treec8617966d3a605707b3ba9021f9e6ff6bd2adaf9 /mysql-test/t/view.test
parenta4e5888248811e625ad703ee4feb717f37b0e38a (diff)
downloadmariadb-git-fe8cf7f13142b034aef9b7f88e6260340c6ac37d.tar.gz
MDEV-18502: Server crash in find_field_in_tables upon 2nd execution of SP which causes ER_WRONG_GROUP_FIELD
Fixed by the commit cb11b3fb. Adding the test case for this issue.
Diffstat (limited to 'mysql-test/t/view.test')
-rw-r--r--mysql-test/t/view.test16
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index d271070bc60..76c47be3efc 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -6463,5 +6463,21 @@ drop view v1;
drop table t1;
--echo #
+--echo # MDEV-18502: Server crash in find_field_in_tables upon 2nd execution of SP which causes ER_WRONG_GROUP_FIELD
+--echo #
+
+CREATE TABLE t1 (id INT, f VARCHAR(1));
+CREATE VIEW v1 AS SELECT * FROM t1;
+INSERT INTO t1 VALUES (1,'a'),(2,'b');
+CREATE PROCEDURE sp() SELECT f AS f1, MAX(id) AS f2 FROM v1 GROUP BY f1, f2 ORDER BY f1;
+--error ER_WRONG_GROUP_FIELD
+CALL sp;
+--error ER_WRONG_GROUP_FIELD
+CALL sp;
+DROP PROCEDURE sp;
+DROP VIEW v1;
+DROP TABLE t1;
+
+--echo #
--echo # End of 10.2 tests
--echo #