DBA privileges with objects and nested UDRs
CREATE DBA PROCEDURE promo()
...
END PROCEDURE;
Although user tony owns the routine, if user marty runs it, user marty owns table hotcatalog. User libby owns libby.maillist because her name qualifies the table name, making her the table owner.
A called routine does not inherit the DBA privilege. If a DBA routine executes a routine that was created without the DBA keyword, the DBA privileges do not affect the called routine.
If a routine that is registered without the DBA keyword calls a DBA routine, the caller must have Execute privileges on the called DBA routine. Statements within the DBA routine execute as they would within any DBA routine.
strcopy(statement, "CREATE INDEX stmt");
ret = mi_exec(conn,
"create cluster index c_clust_ix on catalog(catalog_num)",
MI_QUERY_NORMAL);
EXECUTE PROCEDURE cluster_catalog(hotcatalog)
CREATE DBA PROCEDURE dbspace_cleanup(loc CHAR)
EXTERNAL NAME ...
LANGUAGE C
END PROCEDURE
CREATE PROCEDURE cluster_catalog(catalog CHAR)
EXTERNAL NAME ...
LANGUAGE C
END PROCEDURE
GRANT EXECUTE ON PROCEDURE dbspace_cleanup(CHAR) to marty;
CREATE PROCEDURE dbspace_cleanup(loc CHAR)
EXTERNAL NAME ...
LANGUAGE C
END PROCEDURE
CREATE DBA PROCEDURE cluster_catalog(catalog CHAR)
EXTERNAL NAME ...
LANGUAGE C
END PROCEDURE
GRANT EXECUTE ON PROCEDURE cluster_catalog(CHAR) to marty;
The dbspace_cleanup() procedure need not be a DBA procedure to call a DBA procedure.