mirror of https://github.com/apache/cassandra
Merge branch 'cassandra-2.1' into trunk
This commit is contained in:
commit
0d0aed85fe
|
|
@ -387,7 +387,7 @@ class CQLHelpTopics(object):
|
|||
|
||||
Counter columns can be incremented or decremented by an arbitrary
|
||||
numeric value though the assignment of an expression that adds or
|
||||
substracts the value.
|
||||
subtracts the value.
|
||||
"""
|
||||
|
||||
def help_update_where(self):
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ public abstract class Operation
|
|||
* This can be one of:
|
||||
* - Setting a value: c = v
|
||||
* - Setting an element of a collection: c[x] = v
|
||||
* - An addition/substraction to a variable: c = c +/- v (where v can be a collection literal)
|
||||
* - An addition/subtraction to a variable: c = c +/- v (where v can be a collection literal)
|
||||
* - An prepend operation: c = v + c
|
||||
*/
|
||||
public interface RawUpdate
|
||||
|
|
@ -303,7 +303,7 @@ public abstract class Operation
|
|||
case SET:
|
||||
return new Sets.Discarder(receiver, value.prepare(keyspace, receiver));
|
||||
case MAP:
|
||||
// The value for a map substraction is actually a set
|
||||
// The value for a map subtraction is actually a set
|
||||
ColumnSpecification vr = new ColumnSpecification(receiver.ksName,
|
||||
receiver.cfName,
|
||||
receiver.name,
|
||||
|
|
|
|||
|
|
@ -288,7 +288,7 @@ public abstract class Sets
|
|||
}
|
||||
}
|
||||
|
||||
// Note that this is reused for Map substraction too (we substract a set from a map)
|
||||
// Note that this is reused for Map subtraction too (we subtract a set from a map)
|
||||
public static class Discarder extends Operation
|
||||
{
|
||||
public Discarder(ColumnDefinition column, Term t)
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ public class CollectionsTest extends CQLTester
|
|||
assertInvalid("UPDATE %s SET m = m + ? WHERE k = 0", list("a", "b"));
|
||||
assertInvalid("UPDATE %s SET m = m - [ 'a', 'b' ] WHERE k = 0");
|
||||
assertInvalid("UPDATE %s SET m = m + ? WHERE k = 0", set("a", "b"));
|
||||
// Note that we do allow substracting a set from a map, but not a map from a map
|
||||
// Note that we do allow subtracting a set from a map, but not a map from a map
|
||||
// TODO: We should remove this 'if' once #7833 is resolved
|
||||
if (!usePrepared())
|
||||
assertInvalid("UPDATE %s SET m = m - ? WHERE k = 0", map("a", "b", "c", "d"));
|
||||
|
|
|
|||
Loading…
Reference in New Issue