Merge branch 'cassandra-2.1' into cassandra-2.2
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/a68f8bd7 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/a68f8bd7 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/a68f8bd7 Branch: refs/heads/trunk Commit: a68f8bd700666e87877993107ad1b20ed957c8a8 Parents: 99b82db 5414950 Author: Aleksey Yeschenko <alek...@apache.org> Authored: Tue Nov 17 16:47:41 2015 +0000 Committer: Aleksey Yeschenko <alek...@apache.org> Committed: Tue Nov 17 16:47:41 2015 +0000 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../cassandra/cql3/statements/AlterTableStatement.java | 3 +++ .../cassandra/cql3/validation/operations/AlterTest.java | 8 ++++++++ 3 files changed, 12 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/a68f8bd7/CHANGES.txt ---------------------------------------------------------------------- diff --cc CHANGES.txt index f5d3416,eea14c8..fb8f89a --- a/CHANGES.txt +++ b/CHANGES.txt @@@ -1,17 -1,5 +1,18 @@@ -2.1.12 +2.2.4 + * Don't do anticompaction after subrange repair (CASSANDRA-10422) + * Fix SimpleDateType type compatibility (CASSANDRA-10027) + * (Hadoop) fix splits calculation (CASSANDRA-10640) + * (Hadoop) ensure that Cluster instances are always closed (CASSANDRA-10058) + * (cqlsh) show partial trace if incomplete after max_trace_wait (CASSANDRA-7645) + * Use most up-to-date version of schema for system tables (CASSANDRA-10652) + * Deprecate memory_allocator in cassandra.yaml (CASSANDRA-10581,10628) + * Expose phi values from failure detector via JMX and tweak debug + and trace logging (CASSANDRA-9526) + * Fix RangeNamesQueryPager (CASSANDRA-10509) + * Deprecate Pig support (CASSANDRA-10542) + * Reduce contention getting instances of CompositeType (CASSANDRA-10433) +Merged from 2.1: + * Forbid compact clustering column type changes in ALTER TABLE (CASSANDRA-8879) * Reject incremental repair with subrange repair (CASSANDRA-10422) * Add a nodetool command to refresh size_estimates (CASSANDRA-9579) * Shutdown compaction in drain to prevent leak (CASSANDRA-10079) http://git-wip-us.apache.org/repos/asf/cassandra/blob/a68f8bd7/src/java/org/apache/cassandra/cql3/statements/AlterTableStatement.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/a68f8bd7/test/unit/org/apache/cassandra/cql3/validation/operations/AlterTest.java ---------------------------------------------------------------------- diff --cc test/unit/org/apache/cassandra/cql3/validation/operations/AlterTest.java index 566c0ea,a6aad87..2cc8a18 --- a/test/unit/org/apache/cassandra/cql3/validation/operations/AlterTest.java +++ b/test/unit/org/apache/cassandra/cql3/validation/operations/AlterTest.java @@@ -201,20 -200,10 +202,27 @@@ public class AlterTest extends CQLTeste } } + /** + * tests CASSANDRA-10027 + */ + @Test + public void testAlterColumnTypeToDate() throws Throwable + { + createTable("CREATE TABLE %s (key int PRIMARY KEY, c1 int);"); + execute("INSERT INTO %s (key, c1) VALUES (1,1);"); + execute("ALTER TABLE %s ALTER c1 TYPE date;"); + assertRows(execute("SELECT * FROM %s"), row(1, 1)); + + createTable("CREATE TABLE %s (key int PRIMARY KEY, c1 varint);"); + execute("INSERT INTO %s (key, c1) VALUES (1,1);"); + assertInvalidMessage("Cannot change c1 from type varint to type date: types are incompatible.", + "ALTER TABLE %s ALTER c1 TYPE date;"); + } ++ + @Test // tests CASSANDRA-8879 + public void testAlterClusteringColumnTypeInCompactTable() throws Throwable + { + createTable("CREATE TABLE %s (key blob, column1 blob, value blob, PRIMARY KEY ((key), column1)) WITH COMPACT STORAGE"); + assertInvalidThrow(InvalidRequestException.class, "ALTER TABLE %s ALTER column1 TYPE ascii"); + } }