Commit 71689875 authored by Alexander Barkov's avatar Alexander Barkov

Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext

parents 4fc1f2fb 8c0129dc
......@@ -755,3 +755,21 @@ GRANT EXECUTE ON PROCEDURE `test`.`sp1` TO 'root'@'localhost'
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
drop procedure sp1;
set password='';
#
# MDEV-13396 Unexpected "alter routine comand defined" during CREATE OR REPLACE PROCEDURE
#
CREATE DATABASE u1;
CREATE PROCEDURE u1.p1() BEGIN SELECT 1; END; $$
CREATE FUNCTION u1.f1() RETURNS INT BEGIN RETURN 1; END; $$
CREATE USER u1@localhost;
GRANT CREATE ROUTINE ON u1.* TO u1@localhost;
GRANT ALTER ROUTINE ON FUNCTION u1.f1 TO u1@localhost;
GRANT ALTER ROUTINE ON PROCEDURE u1.p1 TO u1@localhost;
connect u1, localhost, u1,,;
USE u1;
CREATE OR REPLACE FUNCTION f1() RETURNS INT BEGIN RETURN 2; END; $$
CREATE OR REPLACE PROCEDURE p1() BEGIN SELECT 1; END; $$
disconnect u1;
connection default;
DROP DATABASE u1;
DROP USER u1@localhost;
......@@ -1023,3 +1023,30 @@ grant execute on procedure sp1 to current_user() identified by 'barfoo';
show grants;
drop procedure sp1;
set password='';
--echo #
--echo # MDEV-13396 Unexpected "alter routine comand defined" during CREATE OR REPLACE PROCEDURE
--echo #
CREATE DATABASE u1;
DELIMITER $$;
CREATE PROCEDURE u1.p1() BEGIN SELECT 1; END; $$
CREATE FUNCTION u1.f1() RETURNS INT BEGIN RETURN 1; END; $$
DELIMITER ;$$
CREATE USER u1@localhost;
GRANT CREATE ROUTINE ON u1.* TO u1@localhost;
GRANT ALTER ROUTINE ON FUNCTION u1.f1 TO u1@localhost;
GRANT ALTER ROUTINE ON PROCEDURE u1.p1 TO u1@localhost;
connect (u1, localhost, u1,,);
USE u1;
DELIMITER $$;
CREATE OR REPLACE FUNCTION f1() RETURNS INT BEGIN RETURN 2; END; $$
CREATE OR REPLACE PROCEDURE p1() BEGIN SELECT 1; END; $$
DELIMITER ;$$
disconnect u1;
connection default;
DROP DATABASE u1;
DROP USER u1@localhost;
......@@ -2937,7 +2937,7 @@ static int mysql_create_routine(THD *thd, LEX *lex)
{
if (check_routine_access(thd, ALTER_PROC_ACL, lex->sphead->m_db.str,
lex->sphead->m_name.str,
lex->sql_command == SQLCOM_DROP_PROCEDURE, 0))
lex->sql_command == SQLCOM_CREATE_PROCEDURE, 0))
return true;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment