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

Robert Stupp commented on CASSANDRA-8355:
-----------------------------------------

Note: the offending NPE is thrown at
{noformat}
java.lang.NullPointerException
        at 
org.apache.cassandra.cql3.functions.FunctionCall$Raw.toString(FunctionCall.java:172)
        at java.lang.String.valueOf(String.java:2981)
        at java.lang.StringBuilder.append(StringBuilder.java:131)
        at 
org.apache.cassandra.cql3.CqlParser.convertPropertyMap(CqlParser.java:327)
        at org.apache.cassandra.cql3.CqlParser.property(CqlParser.java:12082)
        at org.apache.cassandra.cql3.CqlParser.properties(CqlParser.java:11988)
        at 
org.apache.cassandra.cql3.CqlParser.alterTableStatement(CqlParser.java:5231)
        at org.apache.cassandra.cql3.CqlParser.cqlStatement(CqlParser.java:784)
        at org.apache.cassandra.cql3.CqlParser.query(CqlParser.java:365)
        at 
org.apache.cassandra.cql3.QueryProcessor.parseStatement(QueryProcessor.java:535)
        at 
org.apache.cassandra.cql3.QueryProcessor.getStatement(QueryProcessor.java:510)
        at 
org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:251)
{noformat}

Can you investigate whether the same issue can occur in {{unaliasedSelector}} 
(~ line 296 in Cql.g)? On a quick code view and some experiments in cqlsh I 
think it cannot, but 4 eyes see more ;)

Otherwise +1 without any objective


> NPE when passing wrong argument in ALTER TABLE statement
> --------------------------------------------------------
>
>                 Key: CASSANDRA-8355
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8355
>             Project: Cassandra
>          Issue Type: Bug
>         Environment: Cassandra 2.1.2
>            Reporter: Pierre Laporte
>            Assignee: Benjamin Lerer
>            Priority: Minor
>             Fix For: 2.1.3
>
>         Attachments: CASSANDRA-8355.txt
>
>
> When I tried to change the caching strategy of a table, I provided a wrong 
> argument {{'rows_per_partition' : ALL}} with unquoted ALL. Cassandra returned 
> a SyntaxError, which is good, but it seems it was because of a 
> NullPointerException.
> *Howto*
> {code}
> CREATE TABLE foo (k int primary key);
> ALTER TABLE foo WITH caching = {'keys' : 'all', 'rows_per_partition' : ALL};
> {code}
> *Output*
> {code}
> <ErrorMessage code=2000 [Syntax error in CQL query] message="Failed parsing 
> statement: [ALTER TABLE foo WITH caching = {'keys' : 'all', 
> 'rows_per_partition' : ALL};] reason: NullPointerException null">
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to