Merge branch 'cassandra-3.3' into trunk
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/0a83e6aa Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/0a83e6aa Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/0a83e6aa Branch: refs/heads/trunk Commit: 0a83e6aa8ebaf6adcc3e23235300d90c66731cf6 Parents: 27d88ee f70c353 Author: Sam Tunnicliffe <s...@beobal.com> Authored: Tue Feb 2 14:39:31 2016 +0000 Committer: Sam Tunnicliffe <s...@beobal.com> Committed: Tue Feb 2 14:47:38 2016 +0000 ---------------------------------------------------------------------- CHANGES.txt | 1 + src/java/org/apache/cassandra/db/ReadCommand.java | 17 ++++++++++++++++- .../cassandra/db/ReadCommandVerbHandler.java | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/0a83e6aa/CHANGES.txt ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/0a83e6aa/src/java/org/apache/cassandra/db/ReadCommand.java ---------------------------------------------------------------------- diff --cc src/java/org/apache/cassandra/db/ReadCommand.java index d1a3e3a,a0b3d55..3adee9f --- a/src/java/org/apache/cassandra/db/ReadCommand.java +++ b/src/java/org/apache/cassandra/db/ReadCommand.java @@@ -1367,8 -1367,23 +1367,23 @@@ public abstract class ReadCommand exten "Fill name in filter (hex): " + ByteBufferUtil.bytesToHex(buffer), metadata.cfId); } - if (!cellName.clustering.equals(Clustering.STATIC_CLUSTERING)) + // If we're querying for a static column, we may also need to read it + // as if it were a thrift dynamic column (because the column metadata, + // which makes it a static column in 3.0+, may have been added *after* + // some values were written). Note that all cql queries on non-compact + // tables used slice & not name filters prior to 3.0 so this path is + // not taken for non-compact tables. It is theoretically possible to + // get here via thrift, hence the check on metadata.isStaticCompactTable. + // See CASSANDRA-11087. + if (metadata.isStaticCompactTable() && cellName.clustering.equals(Clustering.STATIC_CLUSTERING)) + { - clusterings.add(new Clustering(cellName.column.name.bytes)); ++ clusterings.add(Clustering.make(cellName.column.name.bytes)); + selectionBuilder.add(metadata.compactValueColumn()); + } + else + { clusterings.add(cellName.clustering); + } selectionBuilder.add(cellName.column); }