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

cqlsh errors on comments that end with a semicolon

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Low
    • Resolution: Fixed
    • Fix Version/s: 0.8 beta 1
    • Component/s: Legacy/Tools
    • Labels:
    • Environment:
    • Severity:
      Low

      Description

      Commented-out lines that end in a semicolon cause an error.

      Examples:

      cqlsh> – CREATE KEYSPACE ELE WITH replication_factor = 3 AND strategy_class = SimpleStrategy AND strategy_options:replication_factor=3;
      Bad Request: line 0:-1 no viable alternative at input '<EOF>'
      cqlsh> – CREATE KEYSPACE ELE WITH replication_factor = 3 AND strategy_class = SimpleStrategy AND strategy_options:replication_factor=3
      ...
      ...
      ... ;
      Bad Request: line 2:0 no viable alternative at input ';'
      cqlsh> – ;
      Bad Request: line 0:-1 no viable alternative at input '<EOF>'
      cqlsh> --;
      Bad Request: line 0:-1 no viable alternative at input '<EOF>'

      As long as there's a line with valid CQL before the semicolon, things work fine though.

      I'm pretty sure the problem is on line 75 of cqlsh:
      if not line.endswith(";"):
      self.set_prompt(Shell.continue_prompt)
      return None

      A quick workaround would be to kill the pretty continue prompt. A more involved fix would detect whether or not the semicolon was in a comment. This is harder than it sounds, since /* and */ allow multi-line comments.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                urandom Eric Evans
                Reporter:
                angryparsley Geoff Greer
                Authors:
                Eric Evans
                Reviewers:
                Gary Dusbabek
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: