Subject RE: [firebird-support] Security.fdb / RDB$SECURITY_CLASSES / ACL / PUBLIC user rights
Author Steffen Heil
Hi

> >CREATE PROCEDURE USERS2_TRG_BS (
> > P_USER_NAME VARCHAR(128))
> >RETURNS (
> > S_DUMMY CHAR(1))
> >AS
> >BEGIN
> > IF (USER='' OR USER='SYSDBA' OR USER=P_USER_NAME)
> > THEN
> > SUSPEND;
> >END

> Permissions. I'm baffled about what the SP is supposed to achieve, since
> it an only ever return null. It doesn't do anything with the return
variable.

As far as I understand that procedure, it returns "null", of the conditions
are true, but returns nothing, of the conditions are false. The difference
is in the count of lines...

> ...
> > WHERE EXISTS (SELECT * FROM USERS2_TRG_BS(USERS2.USER_NAME));

> The WHERE clause will always return True, since it always returns a result

> of null. So the question is - why is it there?

No, exists results in true, of there are any rows, false otherwise. For my
understanding, there is no problem of having the only result being 'null'.

Anything wrong with my interpretation?

Regards,
Steffen