Skip to content

Commit

Permalink
re-allow indexing empty column values
Browse files Browse the repository at this point in the history
patch by yukim; reviewed by jbellis for CASSANDRA-4031
  • Loading branch information
jbellis committed Mar 20, 2012
1 parent c5aa781 commit 050e61a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/java/org/apache/cassandra/cql/UpdateStatement.java
Expand Up @@ -36,6 +36,7 @@
import org.apache.cassandra.thrift.InvalidRequestException;

import static org.apache.cassandra.cql.QueryProcessor.validateColumn;
import static org.apache.cassandra.cql.QueryProcessor.validateKey;

import static org.apache.cassandra.thrift.ThriftValidation.validateColumnFamily;
import static org.apache.cassandra.thrift.ThriftValidation.validateCommutativeForWrite;
Expand Down Expand Up @@ -185,6 +186,7 @@ public List<IMutation> prepareRowMutations(String keyspace, ClientState clientSt
private IMutation mutationForKey(String keyspace, ByteBuffer key, CFMetaData metadata, Long timestamp, ClientState clientState, List<ByteBuffer> variables)
throws InvalidRequestException
{
validateKey(key);
AbstractType<?> comparator = getComparator(keyspace);

// if true we need to wrap RowMutation into CounterMutation
Expand Down
Expand Up @@ -32,6 +32,7 @@
import org.apache.cassandra.utils.ByteBufferUtil;

import static org.apache.cassandra.cql.QueryProcessor.validateColumnName;
import static org.apache.cassandra.cql.QueryProcessor.validateKey;

import static org.apache.cassandra.thrift.ThriftValidation.validateColumnFamily;
import static org.apache.cassandra.thrift.ThriftValidation.validateCommutativeForWrite;
Expand Down Expand Up @@ -148,6 +149,7 @@ else if (firstEmpty != null)
private IMutation mutationForKey(CFDefinition cfDef, ClientState clientState, ByteBuffer key, ColumnNameBuilder builder, List<ByteBuffer> variables)
throws InvalidRequestException
{
validateKey(key);
// if true we need to wrap RowMutation into CounterMutation
boolean hasCounterColumn = false;
RowMutation rm = new RowMutation(cfDef.cfm.ksName, key);
Expand Down
2 changes: 1 addition & 1 deletion src/java/org/apache/cassandra/db/DecoratedKey.java
Expand Up @@ -52,7 +52,7 @@ public int compare(DecoratedKey o1, DecoratedKey o2)

public DecoratedKey(T token, ByteBuffer key)
{
assert token != null && key != null && key.remaining() > 0;
assert token != null && key != null;
this.token = token;
this.key = key;
}
Expand Down

0 comments on commit 050e61a

Please sign in to comment.