IGNITE-5729 Added query validations to proxy. Fixed .NET test.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/591566e9 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/591566e9 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/591566e9 Branch: refs/heads/ignite-5757 Commit: 591566e9d8323ca2f3e28b43c421e35909ef9cb7 Parents: ff7ba72 Author: Pavel Kovalenko <[email protected]> Authored: Fri Jul 28 16:42:31 2017 +0300 Committer: Pavel Kovalenko <[email protected]> Committed: Fri Jul 28 16:43:11 2017 +0300 ---------------------------------------------------------------------- .../internal/processors/cache/IgniteCacheProxyImpl.java | 7 ++++--- .../Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs | 3 +-- 2 files changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/591566e9/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxyImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxyImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxyImpl.java index b94afa1..0bc3ba2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxyImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxyImpl.java @@ -677,14 +677,15 @@ public class IgniteCacheProxyImpl<K, V> extends AsyncSupportAdapter<IgniteCache< */ private void validate(Query qry) { if (!QueryUtils.isEnabled(ctx.config()) && !(qry instanceof ScanQuery) && - !(qry instanceof ContinuousQuery) && !(qry instanceof SpiQuery)) + !(qry instanceof ContinuousQuery) && !(qry instanceof SpiQuery) && !(qry instanceof SqlQuery) && + !(qry instanceof SqlFieldsQuery)) throw new CacheException("Indexing is disabled for cache: " + ctx.cache().name() + - ". Use setIndexedTypes or setTypeMetadata methods on CacheConfiguration to enable."); + ". Use setIndexedTypes or setTypeMetadata methods on CacheConfiguration to enable."); if (!ctx.kernalContext().query().moduleEnabled() && (qry instanceof SqlQuery || qry instanceof SqlFieldsQuery || qry instanceof TextQuery)) throw new CacheException("Failed to execute query. Add module 'ignite-indexing' to the classpath " + - "of all Ignite nodes."); + "of all Ignite nodes."); } /** {@inheritDoc} */ http://git-wip-us.apache.org/repos/asf/ignite/blob/591566e9/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs index 500c3fb..ae2fe8f 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/CacheQueriesTest.cs @@ -489,8 +489,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Query // SQL query. err = Assert.Throws<IgniteException>(() => cache.Query(new SqlQuery(typeof(QueryPerson), "age < 50"))); - Assert.AreEqual("Indexing is disabled for cache: nonindexed_cache. " + - "Use setIndexedTypes or setTypeMetadata methods on CacheConfiguration to enable.", err.Message); + Assert.AreEqual("Failed to find SQL table for type: QueryPerson", err.Message); } /// <summary>
