-
-
Notifications
You must be signed in to change notification settings - Fork 596
Open
Labels
Description
I am currently trying to set up a robust user system for my project where specific users are only granted exactly the permissions they need for executing their function, where I stumbled over this error: Seems the permission cascading only uses the permissions of the invoker of a procedure, even if explicitly specified as SQL SECURITY DEFINER (which is also the default in mysql).
$ mysql -u root -D dolt_testing
> CREATE TABLE t (id BINARY(2));
> CREATE PROCEDURE p () SQL SECURITY DEFINER SELECT id FROM t;
> CREATE USER testuser@localhost;
> GRANT EXECUTE ON PROCEDURE dolt_testing.p TO testuser@localhost;
> CALL p();
Empty set (0.00 sec)
>^Z
Bye
$ mysql -u testuser -D dolt_testing
> CALL p();
ERROR 1105 (HY000): Access denied for user 'testuser'@'localhost' to table 't'