Repository: cassandra Updated Branches: refs/heads/cassandra-2.2 06e742fc7 -> c34a32921
Consistent error message for mixed counters, non-counters Patch by Carl Yeksigian; reviewed by Tyler Hobbs for CASSANDRA-9492 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/f294ee12 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/f294ee12 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/f294ee12 Branch: refs/heads/cassandra-2.2 Commit: f294ee12722d074006bb3a5bc72edf2b248b1d6b Parents: e1a67a4 Author: Carl Yeksigian <c...@apache.org> Authored: Fri May 29 14:15:10 2015 -0500 Committer: Tyler Hobbs <tylerlho...@gmail.com> Committed: Fri May 29 14:15:10 2015 -0500 ---------------------------------------------------------------------- CHANGES.txt | 2 ++ .../cassandra/cql3/statements/CreateTableStatement.java | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/f294ee12/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 422f66e..0eb0751 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,6 @@ 2.1.6 + * Consistent error message when a table mixes counter and non-counter + columns (CASSANDRA-9492) * Avoid getting unreadable keys during anticompaction (CASSANDRA-9508) * (cqlsh) Better float precision by default (CASSANDRA-9224) * Improve estimated row count (CASSANDRA-9107) http://git-wip-us.apache.org/repos/asf/cassandra/blob/f294ee12/src/java/org/apache/cassandra/cql3/statements/CreateTableStatement.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/cql3/statements/CreateTableStatement.java b/src/java/org/apache/cassandra/cql3/statements/CreateTableStatement.java index 17fd6fd..5c4e9e2 100644 --- a/src/java/org/apache/cassandra/cql3/statements/CreateTableStatement.java +++ b/src/java/org/apache/cassandra/cql3/statements/CreateTableStatement.java @@ -53,7 +53,14 @@ public class CreateTableStatement extends SchemaAlteringStatement private boolean isDense; - private final Map<ColumnIdentifier, AbstractType> columns = new HashMap<ColumnIdentifier, AbstractType>(); + // use a TreeMap to preserve ordering across JDK versions (see CASSANDRA-9492) + private final Map<ColumnIdentifier, AbstractType> columns = new TreeMap<>(new Comparator<ColumnIdentifier>() + { + public int compare(ColumnIdentifier o1, ColumnIdentifier o2) + { + return o1.bytes.compareTo(o2.bytes); + } + }); private final Set<ColumnIdentifier> staticColumns; private final CFPropDefs properties; private final boolean ifNotExists;