Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Fix Version/s: 0.8.8, 1.0.1
    • Component/s: Core
    • Labels:

      Description

      It's not clear why, but the CQL grammar specification in Cql.g allows for an empty WHERE clause on DELETE, i.e.:

      DELETE FROM someCF WHERE;
      

      When this is used, with or without a column list, it causes an NPE on the node processing the CQL. Traceback on a recent 1.0.0 build:

      ERROR [pool-2-thread-1] 2011-10-11 15:45:25,655 Cassandra.java (line 4082) Internal error processing execute_cql_query
      java.lang.NullPointerException
              at org.apache.cassandra.cql.CqlParser.deleteStatement(CqlParser.java:1994)
              at org.apache.cassandra.cql.CqlParser.query(CqlParser.java:292)
              at org.apache.cassandra.cql.QueryProcessor.getStatement(QueryProcessor.java:984)
              at org.apache.cassandra.cql.QueryProcessor.process(QueryProcessor.java:500)
              at org.apache.cassandra.thrift.CassandraServer.execute_cql_query(CassandraServer.java:1268)
              at org.apache.cassandra.thrift.Cassandra$Processor$execute_cql_query.process(Cassandra.java:4072)
              at org.apache.cassandra.thrift.Cassandra$Processor.process(Cassandra.java:2889)
              at org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:187)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
              at java.lang.Thread.run(Thread.java:680)
      

      The CQL client gets an error with the message, "Internal application error".

      It might be better to allow leaving off the "WHERE" as well as the condition, to match SQL semantics, although fixing that probably won't solve this problem.

      1. CASSANDRA-3349.patch
        0.9 kB
        Pavel Yaskevich

        Activity

        Hide
        Jonathan Ellis added a comment -

        We don't want to allow leaving it off, because we don't support scan-and-delete server-side. (And truncate is far more performant.)

        I'd rather fix by requiring the rest of the WHERE.

        Show
        Jonathan Ellis added a comment - We don't want to allow leaving it off, because we don't support scan-and-delete server-side. (And truncate is far more performant.) I'd rather fix by requiring the rest of the WHERE.
        Hide
        Pavel Yaskevich added a comment -

        rebased with the latest 0.8 branch (last commit 9b9c4d32973ea4e586031775b3322180169135cd)

        Show
        Pavel Yaskevich added a comment - rebased with the latest 0.8 branch (last commit 9b9c4d32973ea4e586031775b3322180169135cd)
        Hide
        Jonathan Ellis added a comment -

        +1

        Show
        Jonathan Ellis added a comment - +1
        Hide
        Jonathan Ellis added a comment -

        committed

        Show
        Jonathan Ellis added a comment - committed
        Hide
        Hudson added a comment -

        Integrated in Cassandra-0.8 #367 (See https://builds.apache.org/job/Cassandra-0.8/367/)
        update CQL grammar to require key clause in delete statement
        patch by pyaskevich; reviewed by jbellis for CASSANDRA-3349

        jbellis : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1182411
        Files :

        • /cassandra/branches/cassandra-0.8/CHANGES.txt
        • /cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/Cql.g
        Show
        Hudson added a comment - Integrated in Cassandra-0.8 #367 (See https://builds.apache.org/job/Cassandra-0.8/367/ ) update CQL grammar to require key clause in delete statement patch by pyaskevich; reviewed by jbellis for CASSANDRA-3349 jbellis : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1182411 Files : /cassandra/branches/cassandra-0.8/CHANGES.txt /cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/cql/Cql.g

          People

          • Assignee:
            Pavel Yaskevich
            Reporter:
            paul cannon
            Reviewer:
            Jonathan Ellis
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development