cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tylerho...@apache.org
Subject git commit: Backport CASSANDRA-7454 to 2.1.0
Date Thu, 17 Jul 2014 19:59:08 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1.0 e4b40c75c -> 9c1782d39


Backport CASSANDRA-7454 to 2.1.0


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/9c1782d3
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/9c1782d3
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/9c1782d3

Branch: refs/heads/cassandra-2.1.0
Commit: 9c1782d39702b8bf8b8380faedc75048ef8bd9b7
Parents: e4b40c7
Author: Tyler Hobbs <tyler@datastax.com>
Authored: Fri Jun 27 09:35:53 2014 -0500
Committer: Tyler Hobbs <tyler@datastax.com>
Committed: Thu Jul 17 14:58:09 2014 -0500

----------------------------------------------------------------------
 CHANGES.txt                                                    | 1 +
 .../apache/cassandra/transport/messages/ExecuteMessage.java    | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/9c1782d3/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 81a35cd..ff417b1 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -9,6 +9,7 @@
  * Support conditional updates, tuple type, and the v3 protocol in cqlsh (CASSANDRA-7509)
  * Handle queries on multiple secondary index types (CASSANDRA-7525)
  * Fix cqlsh authentication with v3 native protocol (CASSANDRA-7564)
+ * Fix NPE when unknown prepared statement ID is used (CASSANDRA-7454)
 Merged from 2.0:
  * (Windows) force range-based repair to non-sequential mode (CASSANDRA-7541)
  * Fix range merging when DES scores are zero (CASSANDRA-7535)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9c1782d3/src/java/org/apache/cassandra/transport/messages/ExecuteMessage.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/transport/messages/ExecuteMessage.java b/src/java/org/apache/cassandra/transport/messages/ExecuteMessage.java
index d618f43..78182b2 100644
--- a/src/java/org/apache/cassandra/transport/messages/ExecuteMessage.java
+++ b/src/java/org/apache/cassandra/transport/messages/ExecuteMessage.java
@@ -102,12 +102,12 @@ public class ExecuteMessage extends Message.Request
         {
             QueryHandler handler = state.getClientState().getCQLQueryHandler();
             ParsedStatement.Prepared prepared = handler.getPrepared(statementId);
+            if (prepared == null)
+                throw new PreparedQueryNotFoundException(statementId);
+
             options.prepare(prepared.boundNames);
             CQLStatement statement = prepared.statement;
 
-            if (statement == null)
-                throw new PreparedQueryNotFoundException(statementId);
-
             if (options.getPageSize() == 0)
                 throw new ProtocolException("The page size cannot be 0");
 


Mime
View raw message