[ 
https://issues.apache.org/jira/browse/DERBY-4191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12779525#action_12779525
 ] 

Mamta A. Satoor commented on DERBY-4191:
----------------------------------------

Thanks for your comment on this jira, Rick. I was starting to look at the jira 
and was thinking about what privileges would be required. 

It seems like Derby has a SELECT level privilege for the table (I think that 
gets used for instance when somebody attempts to lock the table) and I thought 
that is what would be required for count(*) or count(1). But it seems like 
SQL-spec is saying that SELECT privilege on any column of the table is enough. 
I think that does make sense because a user can easily get count(*) equivalent 
by going count(columnwithselectprivilege) and hence it should be fine to have 
select privilege on any column to do count(*) or count(1) equivalent.

> Lack of SELECT privilege does not prevent SELECT COUNT(*)
> ---------------------------------------------------------
>
>                 Key: DERBY-4191
>                 URL: https://issues.apache.org/jira/browse/DERBY-4191
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.2.0, 10.5.1.1
>            Reporter: Knut Anders Hatlen
>         Attachments: repro.sql
>
>
> A user that does not have SELECT privilege on a table can still perform a 
> SELECT COUNT(*) on that table. Counting a specific column (e.g., SELECT 
> COUNT(X)) is prevented.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to