[jira] [Commented] (TRAFODION-3103) Add Descriptions and Examples for *GRANT Statement* in *Trafodion SQL Reference Manual*

2018-06-19 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/TRAFODION-3103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16517683#comment-16517683
 ] 

ASF GitHub Bot commented on TRAFODION-3103:
---

Github user asfgit closed the pull request at:

https://github.com/apache/trafodion/pull/1601


> Add Descriptions and Examples for *GRANT Statement* in *Trafodion SQL 
> Reference Manual*
> ---
>
> Key: TRAFODION-3103
> URL: https://issues.apache.org/jira/browse/TRAFODION-3103
> Project: Apache Trafodion
>  Issue Type: Documentation
>Reporter: Liu Yu
>Assignee: Liu Yu
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TRAFODION-3103) Add Descriptions and Examples for *GRANT Statement* in *Trafodion SQL Reference Manual*

2018-06-11 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/TRAFODION-3103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16509088#comment-16509088
 ] 

ASF GitHub Bot commented on TRAFODION-3103:
---

Github user liuyu000 commented on a diff in the pull request:

https://github.com/apache/trafodion/pull/1601#discussion_r194599785
  
--- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
@@ -5958,6 +6098,122 @@ GRANT SELECT (part_no, part_name), DELETE ON TABLE 
invent.partloc
 GRANT SELECT ON TABLE invent.partloc TO ajones;
 ```
 
+* This example explains how to grant the `SELECT` privilege to PUBLIC.
+
++
+The _testuser1_ creates the table _t1_. The _testuser2_ and _testuser3_ do 
not have the `SELECT` privilege on the table _t1_.
+
++
+_testuser2_:
+
++
+```
+SQL>SELECT * FROM t1;
+
+*** ERROR[4481] The testuser2 does not have SELECT privilege on table or 
view TRAFODION.SEABASE.T1. [2018-06-11 11:39:16]
+```
+
++
+The _testuser1_ grants the `SELECT` privilege on table _t1_ to PUBLIC, 
which means granting `SELECT` privilege to all users (_testuser2_ and 
_testuser3_). 
+
--- End diff --

Thanks @robertamarton, your comment has been incorporated :pencil2:


> Add Descriptions and Examples for *GRANT Statement* in *Trafodion SQL 
> Reference Manual*
> ---
>
> Key: TRAFODION-3103
> URL: https://issues.apache.org/jira/browse/TRAFODION-3103
> Project: Apache Trafodion
>  Issue Type: Documentation
>Reporter: Liu Yu
>Assignee: Liu Yu
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TRAFODION-3103) Add Descriptions and Examples for *GRANT Statement* in *Trafodion SQL Reference Manual*

2018-06-11 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/TRAFODION-3103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16509085#comment-16509085
 ] 

ASF GitHub Bot commented on TRAFODION-3103:
---

Github user liuyu000 commented on a diff in the pull request:

https://github.com/apache/trafodion/pull/1601#discussion_r194599335
  
--- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
@@ -5928,19 +5970,117 @@ Specifies the list of columns to grant the 
requested privilege to.
 [[grant_authorization_and_availability_requirements]]
  Authorization and Availability Requirements
 
-To grant a privilege on an object, you must have both that privilege and 
the right to grant that privilege. Privileges can 
-be granted directly to you or to one of the roles you have been granted. 
You can grant a privilege on an object if you are 
-the owner of the object (by which you are implicitly granted all 
privileges on the object) or the owner of the schema containing 
-the object, or if you have been granted both the privilege and the WITH 
GRANT OPTION for the privilege.
+* To grant a privilege on an object, you must have both that privilege and 
the right to grant that privilege. 
 
-If granting privileges on behalf of a role, you must specify the role in 
the [GRANTED] BY clause. To grant the privileges on 
-behalf of a role, you must be a member of the role, and the role must have 
the authority to grant the privileges; that is, the 
-role must have been granted the privileges WITH GRANT OPTION.
+* Privileges can be granted directly to you or to one of the roles you 
have been granted. 
+
+* You can grant a privilege on an object if one of the following is true:
++
+** If you are the owner of the object (by which you are implicitly granted 
all privileges on the object). 
+
++
+** The owner of the schema contains the object.
+
++
+** If you have been granted both the privilege and the `WITH GRANT OPTION` 
for the privilege.
+
+* If granting privileges on behalf of a role, you must specify the role in 
the `[GRANTED] BY` clause. 
++
+To grant the privileges on behalf of a role, you must be a member of the 
role, and the role must have the authority to grant the privileges; 
+that is, the role must have been granted the privileges `WITH GRANT 
OPTION`.
+
+* If you lack authority to grant:
+
+** If you lack authority to grant one or more of the specified privileges, 
SQL returns a warning (yet does grant the specified 
+privileges for which you do have authority to grant). 
+
++
+*Example*
+
++
+The owner of the table _customer_ is the _testuser1_, who grants `DELETE`, 
`INSERT` and `REFERENCES` privileges on the table _customer_ 
+to the user _testuser2_ with `WITH GRANT OPTION`.
+
++
+_testuser1_:
 
-If you lack authority to grant one or more of the specified privileges, 
SQL returns a warning (yet does grant the specified 
-privileges for which you do have authority to grant). If you lack 
authority to grant any of the specified privileges, SQL returns 
++ 
+```
+SQL>GRANT DELETE, INSERT, REFERENCES ON customer TO testuser2 WITH GRANT 
OPTION;
+
+--- SQL operation complete.
+```
+
++
+Then the _testuser2_ tries to grant all privileges on the table _customer_ 
to the _testuser3_ but fails because of lacking `SELECT` and 
+`UPDATE` privileges, only successfully grants those privileges (`DELETE`, 
`INSERT` and `REFERENCES`) for which the _testuser2_ has 
+grant options.
+
--- End diff --

Thanks @robertamarton, your comment has been incorporated :relaxed:


> Add Descriptions and Examples for *GRANT Statement* in *Trafodion SQL 
> Reference Manual*
> ---
>
> Key: TRAFODION-3103
> URL: https://issues.apache.org/jira/browse/TRAFODION-3103
> Project: Apache Trafodion
>  Issue Type: Documentation
>Reporter: Liu Yu
>Assignee: Liu Yu
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TRAFODION-3103) Add Descriptions and Examples for *GRANT Statement* in *Trafodion SQL Reference Manual*

2018-06-11 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/TRAFODION-3103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16509083#comment-16509083
 ] 

ASF GitHub Bot commented on TRAFODION-3103:
---

Github user liuyu000 commented on a diff in the pull request:

https://github.com/apache/trafodion/pull/1601#discussion_r194598325
  
--- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
@@ -5860,7 +5863,7 @@ column-list is:
 <<<
 === syntax description of grant
 
-* `_privilege_ [,_privilege_ ]  | all [privileges]`
+* `_privilege-name_ [,_privilege-name_ ]  | all [privileges]`
 +
--- End diff --

 is the unicode for "…" (hellip) :smiley_cat:
For more information, see 
https://www.w3schools.com/charsets/ref_html_entities_h.asp.


> Add Descriptions and Examples for *GRANT Statement* in *Trafodion SQL 
> Reference Manual*
> ---
>
> Key: TRAFODION-3103
> URL: https://issues.apache.org/jira/browse/TRAFODION-3103
> Project: Apache Trafodion
>  Issue Type: Documentation
>Reporter: Liu Yu
>Assignee: Liu Yu
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TRAFODION-3103) Add Descriptions and Examples for *GRANT Statement* in *Trafodion SQL Reference Manual*

2018-06-11 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/TRAFODION-3103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16509034#comment-16509034
 ] 

ASF GitHub Bot commented on TRAFODION-3103:
---

Github user liuyu000 commented on a diff in the pull request:

https://github.com/apache/trafodion/pull/1601#discussion_r194591669
  
--- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
@@ -5819,13 +5819,16 @@ System Version 0.9.1. Expected Version 1.0.0.
 The GRANT statement grants access privileges on an SQL object and its 
columns to specified users or roles.
 Privileges can be granted on the object, on one or more columns, or both.
 
+TIP: As the owner who creates the object has all privileges by default, 
there is no need to grant privileges to the owner.
+The owner could grant/revoke privileges to/from other users or roles for 
safety.
--- End diff --

Thanks @robertamarton, your comment has been incorporated :smile: 


> Add Descriptions and Examples for *GRANT Statement* in *Trafodion SQL 
> Reference Manual*
> ---
>
> Key: TRAFODION-3103
> URL: https://issues.apache.org/jira/browse/TRAFODION-3103
> Project: Apache Trafodion
>  Issue Type: Documentation
>Reporter: Liu Yu
>Assignee: Liu Yu
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TRAFODION-3103) Add Descriptions and Examples for *GRANT Statement* in *Trafodion SQL Reference Manual*

2018-06-11 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/TRAFODION-3103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16508229#comment-16508229
 ] 

ASF GitHub Bot commented on TRAFODION-3103:
---

Github user robertamarton commented on a diff in the pull request:

https://github.com/apache/trafodion/pull/1601#discussion_r194449554
  
--- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
@@ -5928,19 +5970,117 @@ Specifies the list of columns to grant the 
requested privilege to.
 [[grant_authorization_and_availability_requirements]]
  Authorization and Availability Requirements
 
-To grant a privilege on an object, you must have both that privilege and 
the right to grant that privilege. Privileges can 
-be granted directly to you or to one of the roles you have been granted. 
You can grant a privilege on an object if you are 
-the owner of the object (by which you are implicitly granted all 
privileges on the object) or the owner of the schema containing 
-the object, or if you have been granted both the privilege and the WITH 
GRANT OPTION for the privilege.
+* To grant a privilege on an object, you must have both that privilege and 
the right to grant that privilege. 
 
-If granting privileges on behalf of a role, you must specify the role in 
the [GRANTED] BY clause. To grant the privileges on 
-behalf of a role, you must be a member of the role, and the role must have 
the authority to grant the privileges; that is, the 
-role must have been granted the privileges WITH GRANT OPTION.
+* Privileges can be granted directly to you or to one of the roles you 
have been granted. 
+
+* You can grant a privilege on an object if one of the following is true:
++
+** If you are the owner of the object (by which you are implicitly granted 
all privileges on the object). 
+
++
+** The owner of the schema contains the object.
+
++
+** If you have been granted both the privilege and the `WITH GRANT OPTION` 
for the privilege.
+
+* If granting privileges on behalf of a role, you must specify the role in 
the `[GRANTED] BY` clause. 
++
+To grant the privileges on behalf of a role, you must be a member of the 
role, and the role must have the authority to grant the privileges; 
+that is, the role must have been granted the privileges `WITH GRANT 
OPTION`.
+
+* If you lack authority to grant:
+
+** If you lack authority to grant one or more of the specified privileges, 
SQL returns a warning (yet does grant the specified 
+privileges for which you do have authority to grant). 
+
++
+*Example*
+
++
+The owner of the table _customer_ is the _testuser1_, who grants `DELETE`, 
`INSERT` and `REFERENCES` privileges on the table _customer_ 
+to the user _testuser2_ with `WITH GRANT OPTION`.
+
++
+_testuser1_:
 
-If you lack authority to grant one or more of the specified privileges, 
SQL returns a warning (yet does grant the specified 
-privileges for which you do have authority to grant). If you lack 
authority to grant any of the specified privileges, SQL returns 
++ 
+```
+SQL>GRANT DELETE, INSERT, REFERENCES ON customer TO testuser2 WITH GRANT 
OPTION;
+
+--- SQL operation complete.
+```
+
++
+Then the _testuser2_ tries to grant all privileges on the table _customer_ 
to the _testuser3_ but fails because of lacking `SELECT` and 
+`UPDATE` privileges, only successfully grants those privileges (`DELETE`, 
`INSERT` and `REFERENCES`) for which the _testuser2_ has 
+grant options.
+
--- End diff --

Word smith suggestion:  Then_testuser2_ tries to grants all privileges on 
table _customer_ to _testuser3_.  The grant command returns a warning stating 
that only some of the privileges were granted.`DELETE`, `INSERT`, and 
`REFERENCES` privileges are granted because _testuser2_ has been granted these 
privileges with grant option . `SELECT` and `UPDATE` privileges are not granted.


> Add Descriptions and Examples for *GRANT Statement* in *Trafodion SQL 
> Reference Manual*
> ---
>
> Key: TRAFODION-3103
> URL: https://issues.apache.org/jira/browse/TRAFODION-3103
> Project: Apache Trafodion
>  Issue Type: Documentation
>Reporter: Liu Yu
>Assignee: Liu Yu
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TRAFODION-3103) Add Descriptions and Examples for *GRANT Statement* in *Trafodion SQL Reference Manual*

2018-06-11 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/TRAFODION-3103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16508228#comment-16508228
 ] 

ASF GitHub Bot commented on TRAFODION-3103:
---

Github user robertamarton commented on a diff in the pull request:

https://github.com/apache/trafodion/pull/1601#discussion_r194449791
  
--- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
@@ -5958,6 +6098,122 @@ GRANT SELECT (part_no, part_name), DELETE ON TABLE 
invent.partloc
 GRANT SELECT ON TABLE invent.partloc TO ajones;
 ```
 
+* This example explains how to grant the `SELECT` privilege to PUBLIC.
+
++
+The _testuser1_ creates the table _t1_. The _testuser2_ and _testuser3_ do 
not have the `SELECT` privilege on the table _t1_.
+
++
+_testuser2_:
+
++
+```
+SQL>SELECT * FROM t1;
+
+*** ERROR[4481] The testuser2 does not have SELECT privilege on table or 
view TRAFODION.SEABASE.T1. [2018-06-11 11:39:16]
+```
+
++
+The _testuser1_ grants the `SELECT` privilege on table _t1_ to PUBLIC, 
which means granting `SELECT` privilege to all users (_testuser2_ and 
_testuser3_). 
+
--- End diff --

Word smith suggestion:  The _testuser1_ grants the ... privilege to all 
current  and future users (_testuser2_ and _testuser3_).


> Add Descriptions and Examples for *GRANT Statement* in *Trafodion SQL 
> Reference Manual*
> ---
>
> Key: TRAFODION-3103
> URL: https://issues.apache.org/jira/browse/TRAFODION-3103
> Project: Apache Trafodion
>  Issue Type: Documentation
>Reporter: Liu Yu
>Assignee: Liu Yu
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TRAFODION-3103) Add Descriptions and Examples for *GRANT Statement* in *Trafodion SQL Reference Manual*

2018-06-11 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/TRAFODION-3103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16508227#comment-16508227
 ] 

ASF GitHub Bot commented on TRAFODION-3103:
---

Github user robertamarton commented on a diff in the pull request:

https://github.com/apache/trafodion/pull/1601#discussion_r194449306
  
--- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
@@ -5819,13 +5819,16 @@ System Version 0.9.1. Expected Version 1.0.0.
 The GRANT statement grants access privileges on an SQL object and its 
columns to specified users or roles.
 Privileges can be granted on the object, on one or more columns, or both.
 
+TIP: As the owner who creates the object has all privileges by default, 
there is no need to grant privileges to the owner.
+The owner could grant/revoke privileges to/from other users or roles for 
safety.
--- End diff --

Word smith suggestion "The user or role that creates the object becomes the 
object owner and has all privileges on the object.  There is no need to grant 
privileges to the owner.  The owner can grant. ...


> Add Descriptions and Examples for *GRANT Statement* in *Trafodion SQL 
> Reference Manual*
> ---
>
> Key: TRAFODION-3103
> URL: https://issues.apache.org/jira/browse/TRAFODION-3103
> Project: Apache Trafodion
>  Issue Type: Documentation
>Reporter: Liu Yu
>Assignee: Liu Yu
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TRAFODION-3103) Add Descriptions and Examples for *GRANT Statement* in *Trafodion SQL Reference Manual*

2018-06-11 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/TRAFODION-3103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16508226#comment-16508226
 ] 

ASF GitHub Bot commented on TRAFODION-3103:
---

Github user robertamarton commented on a diff in the pull request:

https://github.com/apache/trafodion/pull/1601#discussion_r194449348
  
--- Diff: docs/sql_reference/src/asciidoc/_chapters/sql_statements.adoc ---
@@ -5860,7 +5863,7 @@ column-list is:
 <<<
 === syntax description of grant
 
-* `_privilege_ [,_privilege_ ]  | all [privileges]`
+* `_privilege-name_ [,_privilege-name_ ]  | all [privileges]`
 +
--- End diff --


what is ?


> Add Descriptions and Examples for *GRANT Statement* in *Trafodion SQL 
> Reference Manual*
> ---
>
> Key: TRAFODION-3103
> URL: https://issues.apache.org/jira/browse/TRAFODION-3103
> Project: Apache Trafodion
>  Issue Type: Documentation
>Reporter: Liu Yu
>Assignee: Liu Yu
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TRAFODION-3103) Add Descriptions and Examples for *GRANT Statement* in *Trafodion SQL Reference Manual*

2018-06-11 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/TRAFODION-3103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16507943#comment-16507943
 ] 

ASF GitHub Bot commented on TRAFODION-3103:
---

GitHub user liuyu000 opened a pull request:

https://github.com/apache/trafodion/pull/1601

[TRAFODION-3103] Add Descriptions and Examples for *GRANT Statement* in 
*Trafodion SQL Reference Manual*



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/liuyu000/trafodion GrantStatement

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/trafodion/pull/1601.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1601


commit dc3042a9abaa9b13887d361ce377b04a06aee92e
Author: liu.yu 
Date:   2018-06-11T11:58:13Z

[TRAFODION-3103] Add Descriptions and Examples for *GRANT Statement* in 
*Trafodion SQL Reference Manual*




> Add Descriptions and Examples for *GRANT Statement* in *Trafodion SQL 
> Reference Manual*
> ---
>
> Key: TRAFODION-3103
> URL: https://issues.apache.org/jira/browse/TRAFODION-3103
> Project: Apache Trafodion
>  Issue Type: Documentation
>Reporter: Liu Yu
>Assignee: Liu Yu
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)