ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [25/50] [abbrv] ignite git commit: ignite-gg-8.0.2.ea2 fix query test
Date Wed, 18 Jan 2017 13:43:42 GMT
ignite-gg-8.0.2.ea2 fix query test


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6e5bfea3
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6e5bfea3
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6e5bfea3

Branch: refs/heads/ignite-gg-11810-2
Commit: 6e5bfea3b71068bc4c4487e68d1d9ced4069005a
Parents: e9bb1d9
Author: Dmitriy Govorukhin <dgovorukhin@gridgain.com>
Authored: Mon Jan 16 21:09:04 2017 +0300
Committer: Dmitriy Govorukhin <dgovorukhin@gridgain.com>
Committed: Mon Jan 16 21:09:04 2017 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/internal/IgnitionEx.java  |  3 ++-
 .../query/h2/opt/GridH2TreeIndex.java           | 26 ++++++++++++--------
 .../query/h2/opt/GridH2TableSelfTest.java       |  8 +++++-
 .../query/h2/sql/GridQueryParsingTest.java      |  4 +--
 4 files changed, 27 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/6e5bfea3/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index b464127..b47ed15 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -2381,7 +2381,8 @@ public class IgnitionEx {
 
                 grid = null;
 
-                stopExecutors(log);
+                if (log != null)
+                    stopExecutors(log);
 
                 log = null;
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/6e5bfea3/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
index 4fa8b0f..0f93f52 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TreeIndex.java
@@ -499,8 +499,8 @@ public class GridH2TreeIndex extends GridH2IndexBase implements Comparator<GridS
         }
 
         /** {@inheritDoc} */
-        @Override public GridH2Row put(GridH2Row value) {
-            return tree.put(value, value);
+        @Override public GridH2Row put(GridH2Row val) {
+            return tree.put(val, val);
         }
 
         /** {@inheritDoc} */
@@ -511,13 +511,19 @@ public class GridH2TreeIndex extends GridH2IndexBase implements Comparator<GridS
         /** {@inheritDoc} */
         @Override public GridCursor<GridH2Row> find(GridSearchRowPointer lower, GridSearchRowPointer
upper)
             throws IgniteCheckedException {
-            if (lower == null || upper == null)
-                throw new NullPointerException();
 
-            NavigableMap<GridSearchRowPointer, GridH2Row> subMap =
-                tree.subMap(lower, false, upper, false);
+            Collection<GridH2Row> rows;
 
-            return new GridCursorIteratorWrapper<>(subMap.values().iterator());
+            if (lower == null && upper == null)
+                rows = tree.values();
+            else if (lower != null && upper == null)
+                rows = tree.tailMap(lower).values();
+            else if (lower == null)
+                rows = tree.headMap(upper).values();
+            else
+                rows = tree.subMap(lower, true, upper, true).values();
+
+            return new GridCursorIteratorWrapper<>(rows.iterator());
         }
 
         /** {@inheritDoc} */
@@ -532,16 +538,16 @@ public class GridH2TreeIndex extends GridH2IndexBase implements Comparator<GridS
 
         /** {@inheritDoc} */
         @Override public IgniteNavigableMapTree clone() {
-            AbstractMap copy;
+            IgniteNavigableMapTree cp;
 
             try {
-                copy = (AbstractMap) super.clone();
+                cp = (IgniteNavigableMapTree)super.clone();
             }
             catch (final CloneNotSupportedException e) {
                 throw DbException.convert(e);
             }
 
-            return new IgniteNavigableMapTree((NavigableMap)copy);
+            return new IgniteNavigableMapTree(cp.tree);
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/6e5bfea3/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TableSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TableSelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TableSelfTest.java
index 5daf415..dcb1840 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TableSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2TableSelfTest.java
@@ -70,6 +70,9 @@ public class GridH2TableSelfTest extends GridCommonAbstractTest {
     /** */
     private static final String PK_NAME = "__GG_PK_";
 
+    /** Hash. */
+    private static final String HASH = "__GG_HASH";
+
     /** */
     private static final String STR_IDX_NAME = "__GG_IDX_";
 
@@ -105,6 +108,7 @@ public class GridH2TableSelfTest extends GridCommonAbstractTest {
                 IndexColumn x = tbl.indexColumn(3, SortOrder.DESCENDING);
 
                 idxs.add(new GridH2TreeIndex(PK_NAME, tbl, true, F.asList(id)));
+                idxs.add(new GridH2TreeIndex(HASH, tbl, true, F.asList(id)));
                 idxs.add(new GridH2TreeIndex(NON_UNIQUE_IDX_NAME, tbl, false, F.asList(x,
t, id)));
                 idxs.add(new GridH2TreeIndex(STR_IDX_NAME, tbl, false, F.asList(str, id)));
 
@@ -601,7 +605,7 @@ public class GridH2TableSelfTest extends GridCommonAbstractTest {
 
             //((GridH2SnapTreeSet)((GridH2Index)idx).tree).print();
 
-            if (rowSet == null)
+            if (rowSet == null || rowSet.isEmpty())
                 rowSet = set;
             else
                 assertEquals(rowSet, set);
@@ -636,6 +640,8 @@ public class GridH2TableSelfTest extends GridCommonAbstractTest {
         while (cursor.next()) {
             GridH2Row row = cursor.get();
 
+            System.out.println(row);
+
             assertNotNull(row);
 
             assertFalse("Incorrect row order in index: " + idx + "\n min: " + min + "\n row:
" + row,

http://git-wip-us.apache.org/repos/asf/ignite/blob/6e5bfea3/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java
index 0992fe2..09a1884 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/GridQueryParsingTest.java
@@ -383,10 +383,10 @@ public class GridQueryParsingTest extends GridCommonAbstractTest {
         checkQuery("update Person p set name='Peter', old = length('zzz') limit 20");
         checkQuery("update Person p set name=DEFAULT, old = null limit ?");
         checkQuery("update Person p set name=? where old >= ? and old < ? limit ?");
-        checkQuery("update Person p set name=(select a.Street from Address a where a.id=p.addrId),
old = (select 42)" +
+        checkQuery("update Person p set name=(select a.Street from \"addr\".Address a where
a.id=p.addrId), old = (select 42)" +
             " where old = sqrt(?)");
         checkQuery("update Person p set (name, old) = (select 'Peter', 42)");
-        checkQuery("update Person p set (name, old) = (select street, id from Address where
id > 5 and id <= ?)");
+        checkQuery("update Person p set (name, old) = (select street, id from \"addr\".Address
where id > 5 and id <= ?)");
     }
 
     /**


Mime
View raw message