summaryrefslogtreecommitdiff
path: root/mysql-test/t/view.test
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2017-09-06 17:20:31 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2017-09-06 17:20:31 +0200
commit2b387855df7be57a3017a5c211543574fa4364d4 (patch)
tree5240ce488bb3477d54fc3a3a3fe675dddcb10c79 /mysql-test/t/view.test
parent80c90887fe952016df86abb6afd9aae02cfcaead (diff)
downloadmariadb-git-2b387855df7be57a3017a5c211543574fa4364d4.tar.gz
MDEV-13523: Group By in a View, called within a Stored Routine causes Error Code 1356 when a non-root user runs the routine for a second time
it is actually test suite for second code chunk fix in MDEV-13439
Diffstat (limited to 'mysql-test/t/view.test')
-rw-r--r--mysql-test/t/view.test38
1 files changed, 38 insertions, 0 deletions
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index de7edd158e5..e2164e438dc 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -6307,5 +6307,43 @@ drop database test_db;
drop user foo@localhost;
--echo #
+--echo # MDEV-13523: Group By in a View, called within a Stored Routine
+--echo # causes Error Code 1356 when a non-root user runs the routine for
+--echo # a second time
+--echo #
+
+CREATE DATABASE bugTest;
+USE bugTest;
+
+CREATE TABLE `procViewTable` (`id` int(10), `someText` varchar(50) NOT NULL);
+insert into `procViewTable` values (1,'Test'), (2,'Test 2');
+
+CREATE USER 'procView'@'%';
+GRANT ALL PRIVILEGES ON `bugTest`.* TO 'procView'@'%';
+
+CREATE DEFINER=`procView`@`%` VIEW `procViewSimple` AS (
+ select * from (
+ select `id` from `bugTest`.`procViewTable`
+ ) `innerQuery`
+ group by `innerQuery`.`id`
+);
+
+--connect (con1,localhost,procView,,)
+use bugTest;
+
+prepare stmt from "SELECT * FROM procViewSimple";
+execute stmt;
+execute stmt;
+
+# Cleanup
+--disconnect con1
+--connection default
+drop user procView;
+drop view procViewSimple;
+drop table procViewTable;
+use test;
+drop database bugTest;
+
+--echo #
--echo # End of 10.2 tests
--echo #