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

BatchlogManager#countAllBatches doesn't swap strings for the count query.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 2.1 rc1
    • None
    • None
    • Low

    Description

      BatchlogManager#countAllBatches doesn't actually swap strings for the query and so yields an Error in the BatchLogManager unit test:

          [junit] Testcase: testReplay(org.apache.cassandra.db.BatchlogManagerTest):	Caused an ERROR
          [junit] Error validating SELECT count(*) FROM %s.%s
          [junit] java.lang.RuntimeException: Error validating SELECT count(*) FROM %s.%s
          [junit] 	at org.apache.cassandra.cql3.QueryProcessor.executeInternal(QueryProcessor.java:274)
          [junit] 	at org.apache.cassandra.db.BatchlogManager.countAllBatches(BatchlogManager.java:102)
          [junit] 	at org.apache.cassandra.db.BatchlogManagerTest.testReplay(BatchlogManagerTest.java:60)
          [junit] Caused by: org.apache.cassandra.exceptions.SyntaxException: line 1:24 no viable alternative at character '%'
      

      Attaching patch that uses a formatted string to replace the %s with the actual ks.cf pair.

      Attachments

        1. trunk-batchlog-counting.txt
          0.8 kB
          Lyuben Todorov

        Issue Links

          Activity

            People

              lyubent Lyuben Todorov
              lyubent Lyuben Todorov
              Lyuben Todorov
              Jonathan Ellis
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: