Merge branch 'cassandra-1.0' into cassandra-1.1.0

Conflicts:
	src/java/org/apache/cassandra/cql/DeleteStatement.java
This commit is contained in:
Sylvain Lebresne 2012-03-29 16:32:52 +02:00
commit e05a327e2c
3 changed files with 5 additions and 4 deletions

View File

@ -47,6 +47,7 @@ Merged from 1.0:
* fix race leading to super columns assertion failure (CASSANDRA-3957)
* ensure that directory is selected for compaction for user-defined
tasks and upgradesstables (CASSANDRA-3985)
* fix NPE on invalid CQL delete command (CASSANDRA-3755)
1.1-beta1

View File

@ -71,6 +71,8 @@ public class DeleteStatement extends AbstractModification
public List<IMutation> prepareRowMutations(String keyspace, ClientState clientState, Long timestamp, List<ByteBuffer> variables) throws InvalidRequestException
{
CFMetaData metadata = validateColumnFamily(keyspace, columnFamily);
clientState.hasColumnFamilyAccess(columnFamily, Permission.WRITE);
AbstractType<?> keyType = Schema.instance.getCFMetaData(keyspace, columnFamily).getKeyValidator();
@ -78,18 +80,17 @@ public class DeleteStatement extends AbstractModification
for (Term key : keys)
{
rowMutations.add(mutationForKey(key.getByteBuffer(keyType, variables), keyspace, timestamp, clientState,variables));
rowMutations.add(mutationForKey(key.getByteBuffer(keyType, variables), keyspace, timestamp, clientState, variables, metadata));
}
return rowMutations;
}
public RowMutation mutationForKey(ByteBuffer key, String keyspace, Long timestamp, ClientState clientState, List<ByteBuffer> variables)
public RowMutation mutationForKey(ByteBuffer key, String keyspace, Long timestamp, ClientState clientState, List<ByteBuffer> variables, CFMetaData metadata)
throws InvalidRequestException
{
RowMutation rm = new RowMutation(keyspace, key);
CFMetaData metadata = validateColumnFamily(keyspace, columnFamily);
QueryProcessor.validateKeyAlias(metadata, keyName);
AbstractType<?> comparator = metadata.getComparatorFor(null);

View File

@ -57,7 +57,6 @@ public class DeleteStatement extends ModificationStatement
public List<IMutation> getMutations(ClientState clientState, List<ByteBuffer> variables) throws InvalidRequestException
{
// Check key
List<Term> keys = processedKeys.get(cfDef.key.name);
if (keys == null || keys.isEmpty())