[MDEV-5782] Error 1370 not handled in stored procedures Created: 2014-03-04 Updated: 2015-06-10 Resolved: 2015-06-09 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Procedure |
| Affects Version/s: | 10.0.8 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Federico Razzoli | Assignee: | Elena Stepanova |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Description |
|
In the following example error 1370 is ok, but I'm trying to handle it, and this seems to be impossible.
|
| Comments |
| Comment by Elena Stepanova [ 2015-05-02 ] | |||||||||||||||||||||||||||||||
|
It doesn't look like a problem with the error. The procedure has the default SQL SECURITY value (DEFINER), so the definer must have the EXECUTE privilege, which it doesn't. It's the execution of the whole procedure that is denied, so how can the handler work? If we modify the test case this way, it works:
| |||||||||||||||||||||||||||||||
| Comment by Federico Razzoli [ 2015-06-09 ] | |||||||||||||||||||||||||||||||
|
In other words, MariaDB checks the permissions before executing the procedure? And in no case 1370 error can occur during the procedure execution? The test case was a simplification of the real-life case. I don't exactly remember what I was trying to do, but in the real-life case there was no definer. However, if the users had not the rights to access the table, I didn't want the whole procedure to fail. | |||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2015-06-10 ] | |||||||||||||||||||||||||||||||
|
There is always a definer, if it's not given explicitly in the CREATE PROCEDURE .. statement, then it's the current user. |