mirror of https://github.com/apache/cassandra
Merge branch 'cassandra-3.1' into trunk
This commit is contained in:
commit
41c69ac556
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
3.1
|
||||
Merged from 2.1:
|
||||
* Reject counter writes in CQLSSTableWriter (CASSANDRA-10258)
|
||||
* Remove superfluous COUNTER_MUTATION stage mapping (CASSANDRA-10605)
|
||||
|
||||
|
||||
|
|
@ -51,7 +52,6 @@ Merged from 2.2:
|
|||
* Expose phi values from failure detector via JMX and tweak debug
|
||||
and trace logging (CASSANDRA-9526)
|
||||
Merged from 2.1:
|
||||
* Remove superfluous COUNTER_MUTATION stage mapping (CASSANDRA-10605)
|
||||
* (cqlsh) fix COPY using wrong variable name for time_format (CASSANDRA-10633)
|
||||
* Do not run SizeEstimatesRecorder if a node is not a member of the ring (CASSANDRA-9912)
|
||||
* Improve handling of dead nodes in gossip (CASSANDRA-10298)
|
||||
|
|
|
|||
|
|
@ -437,6 +437,8 @@ public class CQLSSTableWriter implements Closeable
|
|||
this.boundNames = p.right;
|
||||
if (this.insert.hasConditions())
|
||||
throw new IllegalArgumentException("Conditional statements are not supported");
|
||||
if (this.insert.isCounter())
|
||||
throw new IllegalArgumentException("Counter update statements are not supported");
|
||||
if (this.boundNames.isEmpty())
|
||||
throw new IllegalArgumentException("Provided insert statement has no bind variables");
|
||||
return this;
|
||||
|
|
|
|||
|
|
@ -140,6 +140,28 @@ public class CQLSSTableWriterTest
|
|||
}
|
||||
}
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void testForbidCounterUpdates() throws Exception
|
||||
{
|
||||
String KS = "cql_keyspace";
|
||||
String TABLE = "counter1";
|
||||
|
||||
File tempdir = Files.createTempDir();
|
||||
File dataDir = new File(tempdir.getAbsolutePath() + File.separator + KS + File.separator + TABLE);
|
||||
assert dataDir.mkdirs();
|
||||
|
||||
String schema = "CREATE TABLE cql_keyspace.counter1 (" +
|
||||
" my_id int, " +
|
||||
" my_counter counter, " +
|
||||
" PRIMARY KEY (my_id)" +
|
||||
")";
|
||||
String insert = String.format("UPDATE cql_keyspace.counter1 SET my_counter = my_counter - ? WHERE my_id = ?");
|
||||
CQLSSTableWriter.builder().inDirectory(dataDir)
|
||||
.forTable(schema)
|
||||
.withPartitioner(StorageService.instance.getPartitioner())
|
||||
.using(insert).build();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSyncWithinPartition() throws Exception
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue