mirror of https://github.com/apache/cassandra
NPE fix on null highestSelectivityIndex
Patch by Berenguer Blasi; reviewed by Sam Tunnicliffe for CASSANDRA-10550
This commit is contained in:
parent
86583af4ca
commit
da8be1c093
|
|
@ -1,4 +1,5 @@
|
||||||
2.1.12
|
2.1.12
|
||||||
|
* Fix potential NPE from handling result of SIM.highestSelectivityIndex (CASSANDRA-10550)
|
||||||
* Fix paging issues with partitions containing only static columns data
|
* Fix paging issues with partitions containing only static columns data
|
||||||
(CASSANDRA-10381)
|
(CASSANDRA-10381)
|
||||||
* Fix conditions on static columns (CASSANDRA-10264)
|
* Fix conditions on static columns (CASSANDRA-10264)
|
||||||
|
|
|
||||||
|
|
@ -858,11 +858,14 @@ public class SecondaryIndexManager
|
||||||
for (SecondaryIndexSearcher searcher : indexSearchers)
|
for (SecondaryIndexSearcher searcher : indexSearchers)
|
||||||
{
|
{
|
||||||
SecondaryIndex highestSelectivityIndex = searcher.highestSelectivityIndex(clause);
|
SecondaryIndex highestSelectivityIndex = searcher.highestSelectivityIndex(clause);
|
||||||
long estimate = highestSelectivityIndex.estimateResultRows();
|
if (highestSelectivityIndex != null)
|
||||||
if (estimate <= bestEstimate)
|
|
||||||
{
|
{
|
||||||
bestEstimate = estimate;
|
long estimate = highestSelectivityIndex.estimateResultRows();
|
||||||
mostSelective = searcher;
|
if (estimate <= bestEstimate)
|
||||||
|
{
|
||||||
|
bestEstimate = estimate;
|
||||||
|
mostSelective = searcher;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1571,7 +1571,7 @@ public class StorageProxy implements StorageProxyMBean
|
||||||
{
|
{
|
||||||
// use our own mean column count as our estimate for how many matching rows each node will have
|
// use our own mean column count as our estimate for how many matching rows each node will have
|
||||||
SecondaryIndex highestSelectivityIndex = searcher.highestSelectivityIndex(command.rowFilter);
|
SecondaryIndex highestSelectivityIndex = searcher.highestSelectivityIndex(command.rowFilter);
|
||||||
resultRowsPerRange = Math.min(resultRowsPerRange, highestSelectivityIndex.estimateResultRows());
|
resultRowsPerRange = highestSelectivityIndex == null ? resultRowsPerRange : Math.min(resultRowsPerRange, highestSelectivityIndex.estimateResultRows());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue