[MDEV-7976] Failed trigger execution when created with definer on no existing user Created: 2015-04-10 Updated: 2017-06-01 Resolved: 2017-06-01 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Triggers |
| Fix Version/s: | N/A |
| Type: | Task | Priority: | Minor |
| Reporter: | VAROQUI Stephane | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | upstream | ||
| Description |
|
Failed trigger execution when created with definer on no existing user |
| Comments |
| Comment by Elena Stepanova [ 2015-04-15 ] |
|
Hi Stephane, Why should it not have failed?
It's much better that the statement fails when privileges cannot be checked properly, rather than they go random. |
| Comment by VAROQUI Stephane [ 2015-04-15 ] |
|
Me was thinking triggers are part of the table definition and grants should be checked according to the session user not the definer, execution of trigger should not follow DEFINER but CALLER. Or did i miss something important in that view? I think MySQL outcome is confusing the ability to remove a trigger that should indeed be checking for the DEFINER user or any super user . |
| Comment by Elena Stepanova [ 2015-04-15 ] |
|
A trigger is a type of a stored procedure, so a lot of SP logic applies to them. http://dev.mysql.com/doc/refman/5.5/en/create-trigger.html
There is also http://dev.mysql.com/doc/refman/5.5/en/stored-programs-security.html |
| Comment by VAROQUI Stephane [ 2015-04-15 ] |
|
i'm not the only one pointing that : In life DBA live the company user are being dropped and the database stop inserting . |
| Comment by Sergei Golubchik [ 2017-06-01 ] |
|
There's nothing we can do here. We can imitate "DROP USER ... CASCADE" behavior and auto-drop a trigger that has non-existent definer. Two problems with that
|