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

cqlsh errors on comments that end with a semicolon

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 0.8 beta 1
    • Legacy/Tools
    • 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

              urandom Eric Evans
              angryparsley Geoff Greer
              Eric Evans
              Gary Dusbabek
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: