mirror of https://github.com/apache/cassandra
Fix NPE in ComponentOfSlice.isEQ()
Patch by Stefania Alborghetti; reviewed by Swen Moczarski for CASSANDRA-12706
This commit is contained in:
parent
cd8a98a2dd
commit
79a16e5e97
|
|
@ -1,4 +1,5 @@
|
|||
3.0.10
|
||||
* Fix NPE in ComponentOfSlice.isEQ() (CASSANDRA-12706)
|
||||
* Fix failure in LogTransactionTest (CASSANDRA-12632)
|
||||
* Fix potentially incomplete non-frozen UDT values when querying with the
|
||||
full primary key specified (CASSANDRA-12605)
|
||||
|
|
|
|||
|
|
@ -745,7 +745,7 @@ public abstract class Slices implements Iterable<Slice>
|
|||
|
||||
public boolean isEQ()
|
||||
{
|
||||
return startValue.equals(endValue);
|
||||
return Objects.equals(startValue, endValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -215,4 +215,25 @@ public class SinglePartitionSliceCommandTest
|
|||
checkForS(pi);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void toCQLStringIsSafeToCall() throws IOException
|
||||
{
|
||||
DecoratedKey key = cfm.decorateKey(ByteBufferUtil.bytes("k1"));
|
||||
|
||||
ColumnFilter columnFilter = ColumnFilter.selection(PartitionColumns.of(s));
|
||||
Slice slice = Slice.make(Slice.Bound.BOTTOM, Slice.Bound.inclusiveEndOf(ByteBufferUtil.bytes("i1")));
|
||||
ClusteringIndexSliceFilter sliceFilter = new ClusteringIndexSliceFilter(Slices.with(cfm.comparator, slice), false);
|
||||
ReadCommand cmd = new SinglePartitionReadCommand(false, MessagingService.VERSION_30, true, cfm,
|
||||
FBUtilities.nowInSeconds(),
|
||||
columnFilter,
|
||||
RowFilter.NONE,
|
||||
DataLimits.NONE,
|
||||
key,
|
||||
sliceFilter);
|
||||
|
||||
String ret = cmd.toCQLString();
|
||||
Assert.assertNotNull(ret);
|
||||
Assert.assertFalse(ret.isEmpty());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue