diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-06-18 12:40:53 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-06-18 15:43:59 +0300 |
commit | 0121d5a790983c08dabedc66e70f862e47f7c8c7 (patch) | |
tree | 5a3912526fd63ed6c1886240724c9116a6ac7577 /mysql-test/main/ps.test | |
parent | 63027a5763b2b9550979366f9e7488b2d9328cc0 (diff) | |
parent | c55de8d40bba29503773a6a56d6f13f19ca7e339 (diff) | |
download | mariadb-git-0121d5a790983c08dabedc66e70f862e47f7c8c7.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test/main/ps.test')
-rw-r--r-- | mysql-test/main/ps.test | 56 |
1 files changed, 53 insertions, 3 deletions
diff --git a/mysql-test/main/ps.test b/mysql-test/main/ps.test index 7ab24cd541d..1cf5124eec1 100644 --- a/mysql-test/main/ps.test +++ b/mysql-test/main/ps.test @@ -4386,9 +4386,6 @@ DROP TABLE t1; --echo # End of MDEV-10866 Extend PREPARE and EXECUTE IMMEDIATE to understand expressions --echo # ---echo # ---echo # End of 10.2 tests ---echo # --echo # @@ -4687,3 +4684,56 @@ execute stmt; execute stmt; execute stmt; drop table t1; + + +--echo # +--echo # MDEV-12060 Crash in EXECUTE IMMEDIATE with an expression returning a GRANT command +--echo # + +CREATE ROLE testrole; +DELIMITER /; +CREATE OR REPLACE PROCEDURE p1() +BEGIN +END; +/ +DELIMITER ;/ + +DELIMITER /; +CREATE PROCEDURE p2 (wgrp VARCHAR(10)) +BEGIN + EXECUTE IMMEDIATE concat('GRANT EXECUTE ON PROCEDURE p1 TO ',wgrp); +END; +/ +DELIMITER ;/ +CALL p2('testrole'); +DROP PROCEDURE p2; + +DELIMITER /; +CREATE PROCEDURE p2 () +BEGIN + EXECUTE IMMEDIATE concat(_utf8'GRANT EXECUTE ON PROCEDURE p1 TO ',_latin1'testrole'); +END; +/ +DELIMITER ;/ +CALL p2(); +DROP PROCEDURE p2; + +DELIMITER /; +CREATE PROCEDURE p2 () +BEGIN + PREPARE stmt FROM concat(_utf8'GRANT EXECUTE ON PROCEDURE p1 TO ',_latin1' testrole'); + EXECUTE stmt; + DEALLOCATE PREPARE stmt; +END; +/ +DELIMITER ;/ +CALL p2(); +DROP PROCEDURE p2; + +DROP PROCEDURE p1; +DROP ROLE testrole; + + +--echo # +--echo # End of 10.2 tests +--echo # |