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

PreparedStatements get mixed up between Keyspaces

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Fix Version/s: 1.2.4
    • Component/s: None
    • Labels:
      None
    • Severity:
      Normal

      Description

      I found this behavior while running the same application using two different keyspaces connected to the same node.

      The prepared statements uses the keyspace that was set while the statement was perpared (public final CFDefinition cfDef).
      When reusing the Statement only the cql-query is used to create a key and the keyspace is ignored. When the same query is prepared and used for two different Keyspaces the wrong keyspace can be used.

      The fix is not to ignore the keyspace when reusing the statement.

        Attachments

        1. CassandraServerCql3Test.java
          8 kB
          David Sauer
        2. patch.txt
          2 kB
          David Sauer

          Activity

            People

            • Assignee:
              davedamoon David Sauer
              Reporter:
              davedamoon David Sauer
              Authors:
              David Sauer
              Reviewers:
              Sylvain Lebresne
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: