Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
Correctness - Unrecoverable Corruption / Loss
-
Critical
-
Low Hanging Fruit
-
Fuzz Test
-
All
-
None
-
Description
The function "org.apache.cassandra.db.marshal.AbstractType#referencesDuration” relies on type overriding for detecting if the type contains a duration, but the hidden types like Composite or DynamicComposite don’t override this… this means that we will be able to create a 2i index for these columns (unless we use SAI as it properly detects this)
CREATE TABLE "tbl" ( "pk1" int, "with_duration" 'CompositeType(ListType(DurationType))', PRIMARY KEY ("pk1") ); CREATE INDEX ON "tbl"("with_duration");
This is able to create the 2i index even though we shouldn’t be able to due to duration not being allowed in indexes.
We have a test method that is able to detect if a type exists in complex types:
AbstractTypeGenerators.contains(type, DurationType.instance);
Could leverage the same logic to avoid maintenance burden with inheritance
Attachments
Attachments
Issue Links
- relates to
-
CASSANDRA-20036 When snapshotting the recreate CQL does not count UDTs from reverse clustering columns
- Resolved
- links to