ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject ignite git commit: IGNITE-6288: SQL: fixed NPE in IgniteH2Indexing.bindPartitionInfoParameter. This closes #2617.
Date Mon, 11 Sep 2017 07:13:55 GMT
Repository: ignite
Updated Branches:
  refs/heads/master d808e33ef -> e383dc405


IGNITE-6288: SQL: fixed NPE in IgniteH2Indexing.bindPartitionInfoParameter. This closes #2617.


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

Branch: refs/heads/master
Commit: e383dc4057436c2fb384f4443d91b16701949fa3
Parents: d808e33
Author: tledkov-gridgain <tledkov@gridgain.com>
Authored: Mon Sep 11 10:13:45 2017 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Mon Sep 11 10:13:45 2017 +0300

----------------------------------------------------------------------
 .../processors/query/h2/IgniteH2Indexing.java   |  2 +-
 .../processors/query/SqlSchemaSelfTest.java     | 32 ++++++++++++++++++++
 2 files changed, 33 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/e383dc40/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
index f4873a0..3d3ed84 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
@@ -2378,7 +2378,7 @@ public class IgniteH2Indexing implements GridQueryIndexing {
         assert partInfo != null;
         assert partInfo.partition() < 0;
 
-        GridH2RowDescriptor desc = dataTable(partInfo.cacheName(),
+        GridH2RowDescriptor desc = dataTable(schema(partInfo.cacheName()),
                 partInfo.tableName()).rowDescriptor();
 
         Object param = H2Utils.convert(params[partInfo.paramIdx()],

http://git-wip-us.apache.org/repos/asf/ignite/blob/e383dc40/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/SqlSchemaSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/SqlSchemaSelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/SqlSchemaSelfTest.java
index 8aaccef..183a884 100644
--- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/SqlSchemaSelfTest.java
+++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/SqlSchemaSelfTest.java
@@ -17,7 +17,9 @@
 
 package org.apache.ignite.internal.processors.query;
 
+import java.util.Collections;
 import org.apache.ignite.IgniteCache;
+import org.apache.ignite.cache.QueryEntity;
 import org.apache.ignite.cache.query.SqlFieldsQuery;
 import org.apache.ignite.cache.query.annotations.QuerySqlField;
 import org.apache.ignite.configuration.CacheConfiguration;
@@ -190,6 +192,36 @@ public class SqlSchemaSelfTest extends GridCommonAbstractTest {
     }
 
     /**
+     * Test simple query.
+     *
+     * @throws Exception If failed.
+     */
+    public void testCustomSchemaName() throws Exception {
+        QueryEntity qe = new QueryEntity()
+            .setValueType(Person.class.getName())
+            .setKeyType(Long.class.getName())
+            .setValueFieldName("_value")
+            .setKeyFieldName("id")
+            .addQueryField("id", Long.class.getName(), null)
+            .addQueryField("_value", Person.class.getName(), null)
+            .addQueryField("name", String.class.getName(), null)
+            .addQueryField("orgId", Long.class.getName(), null);
+
+        qe.setTableName("Person");
+
+        IgniteCache<Long, Person> cache = node.createCache(new CacheConfiguration<Long,
Person>()
+            .setName(CACHE_PERSON)
+            .setQueryEntities(Collections.singletonList(qe))
+            .setSqlSchema("TEST"));
+
+        cache.put(1L, new Person("Vasya", 2));
+
+        assertEquals(1, node.context().query().querySqlFieldsNoCache(
+            new SqlFieldsQuery("SELECT id, name, orgId FROM TEST.Person where (id = ?)").setArgs(1L),
false
+        ).getAll().size());
+    }
+
+    /**
      * Test type conflict in public schema.
      *
      * @throws Exception If failed.


Mime
View raw message