From 7b1e2ed6e3d97e445cfdc877b190feafa1550fd5 Mon Sep 17 00:00:00 2001 From: Corentin Chary Date: Tue, 6 Dec 2016 14:59:25 +0100 Subject: [PATCH] Fix primary index calculation for SASI Patch by Corentin Chary; reviewed by Alex Petrov for CASSANDRA-12910. --- CHANGES.txt | 2 ++ .../org/apache/cassandra/index/sasi/plan/QueryController.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 8b2bed7d97..b581977ff3 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 3.12 + * Fix primary index calculation for SASI (CASSANDRA-12910) * Expose time spent waiting in thread pool queue (CASSANDRA-8398) * Conditionally update index built status to avoid unnecessary flushes (CASSANDRA-12969) * NoReplicationTokenAllocator should work with zero replication factor (CASSANDRA-12983) @@ -6,6 +7,7 @@ * Add support for arithmetic operators (CASSANDRA-11935) * Tables in system_distributed should not use gcgs of 0 (CASSANDRA-12954) + 3.10 * Use correct bounds for all-data range when filtering (CASSANDRA-12666) * Remove timing window in test case (CASSANDRA-12875) diff --git a/src/java/org/apache/cassandra/index/sasi/plan/QueryController.java b/src/java/org/apache/cassandra/index/sasi/plan/QueryController.java index fa1181fa7f..155cd4f76a 100644 --- a/src/java/org/apache/cassandra/index/sasi/plan/QueryController.java +++ b/src/java/org/apache/cassandra/index/sasi/plan/QueryController.java @@ -236,7 +236,7 @@ public class QueryController continue; Set indexes = applyScope(view.match(e)); - if (primaryIndexes.size() > indexes.size()) + if (expression == null || primaryIndexes.size() > indexes.size()) { primaryIndexes = indexes; expression = e;