ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject incubator-ignite git commit: ignite-sal-tests queryFields check added
Date Thu, 12 Feb 2015 16:10:00 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-sql-tests-index c13c569c8 -> f1bee5d21


ignite-sal-tests queryFields check added


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

Branch: refs/heads/ignite-sql-tests-index
Commit: f1bee5d21c1c6e82a2992bbe0a0741029863b26f
Parents: c13c569
Author: avinogradov <avinogradov@gridgain.com>
Authored: Thu Feb 12 19:09:52 2015 +0300
Committer: avinogradov <avinogradov@gridgain.com>
Committed: Thu Feb 12 19:09:52 2015 +0300

----------------------------------------------------------------------
 .../internal/processors/cache/IgniteCacheProxy.java    |  4 ++++
 .../cache/GridCacheQueryIndexDisabledSelfTest.java     | 13 +++++++++++++
 2 files changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f1bee5d2/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
index c837d03..23b0623 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
@@ -370,6 +370,10 @@ public class IgniteCacheProxy<K, V> extends AsyncSupportAdapter<IgniteCache<K,
V
         GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
 
         try {
+
+            if (!ctx.config().isQueryIndexEnabled())
+                throw new CacheException("Indexing is disabled for cache: " + ctx.cache().name());
+
             if (ctx.isReplicated() || ctx.isLocal())
                 return doLocalFieldsQuery(qry);
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/f1bee5d2/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryIndexDisabledSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryIndexDisabledSelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryIndexDisabledSelfTest.java
index ebb7eec..a99f46b 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryIndexDisabledSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheQueryIndexDisabledSelfTest.java
@@ -98,6 +98,19 @@ public class GridCacheQueryIndexDisabledSelfTest extends GridCommonAbstractTest
         catch (Exception e) {
             assert false;
         }
+
+        try {
+            List<List<?>> res =
+                cache.queryFields(new SqlFieldsQuery("select * from Person")).getAll();
+
+            assert false;
+        }
+        catch (CacheException e) {
+            X.println("Caught expected exception: " + e);
+        }
+        catch (Exception e) {
+            assert false;
+        }
     }
 
     /**


Mime
View raw message