[MDEV-13396] Unexpected "alter routine comand defined" during CREATE OR REPLACE PROCEDURE Created: 2017-07-28 Updated: 2017-07-28 Resolved: 2017-07-28 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Authentication and Privilege System, Stored routines |
| Affects Version/s: | 10.1, 10.2, 10.3 |
| Fix Version/s: | 10.2.8 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | security | ||
| Issue Links: |
|
||||||||
| Description |
|
Using the root account (mysql -uroot), I create a new database u1 with procedure p1 and function f1:
Also, in the same root session, I create a new user u1 and grant ALTER ROUTINE on p1 and f1:
Now I connect with the new user (mysql --user=u1 u1) and replace the function f1:
It works fine:
Now, in the same session for the user u1, I replace the procedure p1:
It fails with this error:
Looks wrong. Replace for the procedure p1 should work, like replace for the function f1 does. The reasons for the problem resides in this piece of the code, in sql_parse.cc:
The test for SQLCOM_DROP_PROCEDURE is wrong. It should test for SQLCOM_CREATE_PROCEDURE. |