merge from 1.2

This commit is contained in:
Jonathan Ellis 2013-08-08 15:50:08 -05:00
commit fdfdd5c12e
2 changed files with 21 additions and 1 deletions

View File

@ -1,6 +1,8 @@
2.0.0
* fix CAS contention timeout (CASSANDRA-5830)
* fix HsHa to respect max frame size (CASSANDRA-4573)
Merged from 1.2:
* Correctly validate sparse composite cells in scrub (CASSANDRA-5855)
2.0.0-rc1
@ -26,6 +28,8 @@ Merged from 1.2:
(CASSANDRA-5752)
* add "all time blocked" to StatusLogger output (CASSANDRA-5825)
* Future-proof inter-major-version schema migrations (CASSANDRA-5845)
* (Hadoop) add CqlPagingRecordReader support for ReversedType in Thrift table
(CASSANDRA-5718)
* Fix reading DeletionTime from 1.1-format sstables (CASSANDRA-5814)
* cqlsh: add collections support to COPY (CASSANDRA-5698)
* retry important messages for any IOException (CASSANDRA-5804)

View File

@ -30,6 +30,7 @@ import java.util.List;
import com.google.common.collect.AbstractIterator;
import org.apache.cassandra.config.CFMetaData;
import org.apache.cassandra.cql3.CFDefinition;
import org.apache.cassandra.db.marshal.*;
import org.apache.cassandra.io.sstable.Descriptor;
import org.apache.cassandra.io.util.DataOutputBuffer;
@ -297,7 +298,22 @@ public class Column implements OnDiskAtom
public void validateFields(CFMetaData metadata) throws MarshalException
{
validateName(metadata);
AbstractType<?> valueValidator = metadata.getValueValidator(name());
CFDefinition cfdef = metadata.getCfDef();
// If this is a CQL table, we need to pull out the CQL column name to look up the correct column type.
// (Note that COMPACT composites are handled by validateName, above.)
ByteBuffer internalName;
if (cfdef.isComposite && !cfdef.isCompact)
{
CompositeType comparator = (CompositeType) metadata.comparator;
internalName = comparator.extractLastComponent(name);
}
else
{
internalName = name;
}
AbstractType<?> valueValidator = metadata.getValueValidator(internalName);
if (valueValidator != null)
valueValidator.validate(value());
}