Uploaded image for project: 'Apache Cassandra'
  1. Apache Cassandra
  2. CASSANDRA-3493

cqlsh complains when you try to do UPDATE with counter columns

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 1.0.3
    • Legacy/Tools
    • None
    • Low

    Description

      trying to do a counter column UPDATE in cqlsh causes an "Invalid syntax" error:

      cqlsh:foo> update brongo SET boo = boo+1 where key='hi';
      Invalid syntax at line 1, char 28
        update brongo SET boo = boo+1 where key='hi';
                                   ^
      

      This is cause cqlsh's lexer doesn't know that + and - are valid operators in CQL. Don't worry, I'm not trying to make cqlsh be able to parse all CQL with exactness- it tries, in order to provide the best tab completion, but when it fails to parse it can still pass on CQL text to the server. This case is different because it's the lexer that can't understand the operators, before we even get to the parser. We do need a working and correct lexer, along with at least minimal parsing capability, in order to reliably split up statements, tell when the user is changing the keyspace, or SELECTing on a columnfamily with ASSUMEd types.

      Also, the parser should be tweaked in a manner similar to CASSANDRA-3418.

      Attachments

        1. 3493.patch.txt
          2 kB
          paul cannon

        Activity

          People

            thepaul paul cannon
            thepaul paul cannon
            paul cannon
            Jonathan Ellis
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: