Skip to content

Commit 01153a2

Browse files
committed
2 parents d0be5fd + 58f3e2c commit 01153a2

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

h2/src/main/org/h2/index/BaseIndex.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,13 @@ public int compareRows(SearchRow rowData, SearchRow compare) {
241241
}
242242
for (int i = 0, len = indexColumns.length; i < len; i++) {
243243
int index = columnIds[i];
244-
Value v = compare.getValue(index);
245-
if (v == null) {
244+
Value v1 = rowData.getValue(index);
245+
Value v2 = compare.getValue(index);
246+
if (v1 == null || v2 == null) {
246247
// can't compare further
247248
return 0;
248249
}
249-
int c = compareValues(rowData.getValue(index), v, indexColumns[i].sortType);
250+
int c = compareValues(v1, v2, indexColumns[i].sortType);
250251
if (c != 0) {
251252
return c;
252253
}
@@ -311,10 +312,6 @@ private int compareValues(Value a, Value b, int sortType) {
311312
if (a == b) {
312313
return 0;
313314
}
314-
boolean aNull = a == null, bNull = b == null;
315-
if (aNull || bNull) {
316-
return SortOrder.compareNull(aNull, sortType);
317-
}
318315
int comp = table.compareTypeSafe(a, b);
319316
if ((sortType & SortOrder.DESCENDING) != 0) {
320317
comp = -comp;

0 commit comments

Comments
 (0)