DELIMITER $$ CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `account`.`myUser_hasRoutinePriv`(vType ENUM('PROCEDURE', 'FUNCTION'), vChain VARCHAR(100) ) RETURNS tinyint(1) NOT DETERMINISTIC READS SQL DATA BEGIN /** * Search if my user has privileges on routines * * @param vType procedure or function * @param vChain string passed with this syntax dbName.tableName * @return vHasPrivilege */ RETURN user_hasRoutinePriv(vType, vChain, myUser_getId()); END$$ DELIMITER ;