You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Simon Zhou (JIRA)" <ji...@apache.org> on 2017/03/26 22:56:41 UTC

[jira] [Commented] (CASSANDRA-13358) AlterViewStatement.checkAccess can throw exceptions

    [ https://issues.apache.org/jira/browse/CASSANDRA-13358?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15942480#comment-15942480 ] 

Simon Zhou commented on CASSANDRA-13358:
----------------------------------------

I didn't see that you have the "if" check as you intended to. Also the coding style in Cassandra is that you have a new line for "catch **".

> AlterViewStatement.checkAccess can throw exceptions
> ---------------------------------------------------
>
>                 Key: CASSANDRA-13358
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-13358
>             Project: Cassandra
>          Issue Type: Bug
>          Components: CQL
>            Reporter: Hao Zhong
>            Assignee: Hao Zhong
>         Attachments: cassandra.patch
>
>
> The AlterViewStatement.checkAccess method has code lines as follow:
> {code:title=AlterViewStatement.java|borderStyle=solid}
>   if (baseTable != null)
>             state.hasColumnFamilyAccess(keyspace(), baseTable.name, Permission.ALTER);
> {code}
> These lines can throw InvalidRequestException. Indeed, DropTableStatement.checkAccess has a similar problem, and was fixed in CASSANDRA-6687. The fixed code is as follow:
> {code:title=DropTableStatement.java|borderStyle=solid}
>  try
>         {
>             state.hasColumnFamilyAccess(keyspace(), columnFamily(), Permission.DROP);
>         }
>         catch (InvalidRequestException e)
>         {
>             if (!ifExists)
>                 throw e;
>         }
> {code}
> Please fix the problem as CASSANDRA-6687 did.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)