You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/10/17 12:12:15 UTC
[2/4] ignite git commit: idx minor
idx minor
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/35787865
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/35787865
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/35787865
Branch: refs/heads/ignite-5937
Commit: 35787865f788a3ae7abb378564e14e4a02f22c7d
Parents: 9c0c952
Author: sboikov <sb...@gridgain.com>
Authored: Tue Oct 17 13:56:54 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Tue Oct 17 13:56:54 2017 +0300
----------------------------------------------------------------------
.../processors/query/h2/database/H2Tree.java | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/35787865/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2Tree.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2Tree.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2Tree.java
index 6214be4..1ebdaea 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2Tree.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/database/H2Tree.java
@@ -204,6 +204,7 @@ public abstract class H2Tree extends BPlusTree<SearchRow, GridH2Row> {
int idx0 = col.column.getColumnId();
Value v2 = row.getValue(idx0);
+
if (v2 == null) {
// Can't compare further.
return 0;
@@ -212,6 +213,7 @@ public abstract class H2Tree extends BPlusTree<SearchRow, GridH2Row> {
Value v1 = rowData.getValue(idx0);
int c = compareValues(v1, v2);
+
if (c != 0)
return InlineIndexHelper.fixSort(c, col.sortType);
}
@@ -233,19 +235,28 @@ public abstract class H2Tree extends BPlusTree<SearchRow, GridH2Row> {
for (int i = 0, len = cols.length; i < len; i++) {
int idx = columnIds[i];
+
Value v1 = r1.getValue(idx);
Value v2 = r2.getValue(idx);
+
if (v1 == null || v2 == null) {
- // can't compare further
+ // Can't compare further.
return 0;
}
+
int c = compareValues(v1, v2);
+
if (c != 0)
return InlineIndexHelper.fixSort(c, cols[i].sortType);
}
+
return 0;
}
- /** Compares two Values. */
+ /**
+ * @param v1 First value.
+ * @param v2 Second value.
+ * @return Comparison result.
+ */
public abstract int compareValues(Value v1, Value v2);
}