Skip to content

Commit 7a9ec43

Browse files
committed
fix: make sure to fetch null index values when null index exists
1 parent 8750468 commit 7a9ec43

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

core/src/main/java/com/orientechnologies/orient/core/sql/executor/FetchFromIndexStep.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,9 @@ && allEqualities((OAndBlock) condition)) {
509509
} else if (isFullTextIndex(index)) {
510510
stream = index.streamEntries(toIndexKey(indexDef, secondValue), isOrderAsc());
511511
storeAcquiredStream(stream);
512+
} else if (allNullCheck((OAndBlock) condition)) {
513+
stream = getStreamForNullKey();
514+
storeAcquiredStream(stream);
512515
} else {
513516
throw new UnsupportedOperationException(
514517
"Cannot evaluate " + this.condition + " on index " + index);
@@ -674,6 +677,18 @@ private static boolean allEqualities(OAndBlock condition) {
674677
return true;
675678
}
676679

680+
private static boolean allNullCheck(OAndBlock condition) {
681+
if (condition == null) {
682+
return false;
683+
}
684+
for (OBooleanExpression exp : condition.getSubBlocks()) {
685+
if (!(exp instanceof OIsNullCondition)) {
686+
return false;
687+
}
688+
}
689+
return true;
690+
}
691+
677692
private void processBetweenCondition() {
678693
OIndexDefinition definition = index.getDefinition();
679694
OExpression key = ((OBetweenCondition) condition).getFirst();

0 commit comments

Comments
 (0)