[ 
http://issues.apache.org/jira/browse/DERBY-1057?page=comments#action_12423997 ] 
            
Mamta A. Satoor commented on DERBY-1057:
----------------------------------------

Laura, here are answers to your questions. It would be great if Satheesh can 
confirm these answers and may be update the spec if required.

********************************************************************************************************
GRANT (file = rrefsqljgrant.html) 
1. In the spec, does "signature = ( data-type, ...)", apply to GRANT or just 
REVOKE? 

It applies to both grant and revoke. I wrote following test to verify it. 
CREATE FUNCTION F_ABS(P1 INT)
RETURNS INT
NO SQL
RETURNS NULL ON NULL INPUT
EXTERNAL NAME 'java.lang.Math.abs'
LANGUAGE JAVA PARAMETER STYLE JAVA;
grant execute on function F_ABS(int) to mamta2;
revoke execute on function F_ABS(int) from mamta2 restrict;

One thing to note is that I couldn't grant execute on multiple functions with 
single grant statement. Not sure if this is an expected behavior
CREATE FUNCTION F_ABS(P1 INT)
RETURNS INT
NO SQL
RETURNS NULL ON NULL INPUT
EXTERNAL NAME 'java.lang.Math.abs'
LANGUAGE JAVA PARAMETER STYLE JAVA;

CREATE FUNCTION F_ABS123(P1 INT)
RETURNS INT
NO SQL
RETURNS NULL ON NULL INPUT
EXTERNAL NAME 'java.lang.Math.abs'
LANGUAGE JAVA PARAMETER STYLE JAVA;

grant execute on function F_ABS(int), F_ABS123(INT) to mamta2;
ERROR 42X01: Syntax error: Encountered "," at line 1, column 37.


2. I think that we need to have an example that shows how to specify more than 
one privilege (if that is possible). For example: GRANT SELECT, UPDATE ON TABLE 
t TO maria,harry. Or does each privilege need to be specified in separate 
statements? 
It is possible to specify more than one privilege to more than one user in 
single grant/revoke statement. I tried following
create table t1(c11 int);
grant update, trigger, select(c11) on t1 to mamta2, mamta3;
grant delete on t1 to mamta2, mamta3, mamta4;
revoke trigger,delete on t1 from mamta2;
********************************************************************************************************

********************************************************************************************************
REVOKE (file = rrefsqljrevoke.html) 
1. Does the RESTRICT apply to both procedures and functions or just procedures? 
Yes, RESTRICT applies to both procedures and functions.

2. The spec does not provide a clear explanation of what "signature" is. The 
spec has "signature = ( data-type, ... )", and the examples do not show this 
used, so it is difficult to know what is appropriate to document here for the 
syntax. Please advise. 
Signature is the parameters that uniquely identifies a routine. I agree, it 
will be good to clarify this with more information in the specification.


3. I think that we need to have an example that shows how to specify more than 
one privilege (if that is possible). For example: REVOKE SELECT, UPDATE ON 
TABLE t TO maria,harry. Or does each privilege need to be specified in a 
separate statement? 
More than one privilege can be revoked from more than one user in a single 
revoke statement.
revoke trigger,delete on t1 from mamta2, mamta3;
********************************************************************************************************

********************************************************************************************************
SYSREQUIREDPERM (file = rrefsistabssysrequiredperm.html) 
1. This table was documented in V2 of the spec but is missing (not crossed out) 
from subsequent versions of Derby-464 spec. Please confirm that this table is 
still needed. Please add it back into the spec or add it back in with 
strikethrough to indicate it is no longer required. 
Laura, the table is no more required. It is in the Derby code with a Jira 
entry(DERBY-1579) to remove it from Derby code.I have removed it from the 
latest spec(grantRevokeSpec_v4_1.html) attached to DERBY-464. I haven't spent 
time in figuring out how to do "strikethrough" in OpenOffice and so I ended up 
just removing it from the spec. Probably not a good excuse.
********************************************************************************************************

********************************************************************************************************
SYSTABLEPERMS (file = rrefsistabssystableperms.html) 
1. I believe that the description for TABLEID is not correct. Please see the 
description for TABLEID in the file for the SYSCOLPERMS table. 
Yes, the description on TABLEID in SYSTABLEPERMS doc is not correct. It should 
match the description used for SYSCOLPERMS.
********************************************************************************************************


> documentation to address Grant/Revoke (Derby-464)
> -------------------------------------------------
>
>                 Key: DERBY-1057
>                 URL: http://issues.apache.org/jira/browse/DERBY-1057
>             Project: Derby
>          Issue Type: Sub-task
>          Components: Documentation
>    Affects Versions: 10.0.2.0
>            Reporter: Eric Radzinski
>         Assigned To: Laura Stewart
>             Fix For: 10.2.0.0
>
>         Attachments: derby1057_devguide.diff, derby1057_devguide_html.zip, 
> derby1057_ref.diff, derby1057_ref_html.zip, devguide_html2.zip, ref_html2.zip
>
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to