Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
8c0129dc
Commit
8c0129dc
authored
Jul 28, 2017
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-13396 Unexpected "alter routine comand defined" during CREATE OR REPLACE PROCEDURE
parent
2a1035b0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
1 deletion
+46
-1
mysql-test/r/sp-security.result
mysql-test/r/sp-security.result
+18
-0
mysql-test/t/sp-security.test
mysql-test/t/sp-security.test
+27
-0
sql/sql_parse.cc
sql/sql_parse.cc
+1
-1
No files found.
mysql-test/r/sp-security.result
View file @
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;
mysql-test/t/sp-security.test
View file @
8c0129dc
...
...
@@ -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
;
sql/sql_parse.cc
View file @
8c0129dc
...
...
@@ -5660,7 +5660,7 @@ mysql_execute_command(THD *thd)
{
if
(
check_routine_access
(
thd
,
ALTER_PROC_ACL
,
lex
->
spname
->
m_db
.
str
,
lex
->
spname
->
m_name
.
str
,
lex
->
sql_command
==
SQLCOM_
DROP
_PROCEDURE
,
0
))
lex
->
sql_command
==
SQLCOM_
CREATE
_PROCEDURE
,
0
))
goto
error
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment