ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IGNITE-6288) NPE on SQL query with parameters on custom schema name
Date Mon, 11 Sep 2017 07:17:00 GMT

    [ https://issues.apache.org/jira/browse/IGNITE-6288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16160828#comment-16160828
] 

ASF GitHub Bot commented on IGNITE-6288:
----------------------------------------

Github user asfgit closed the pull request at:

    https://github.com/apache/ignite/pull/2617


> NPE on SQL query with parameters on custom schema name
> ------------------------------------------------------
>
>                 Key: IGNITE-6288
>                 URL: https://issues.apache.org/jira/browse/IGNITE-6288
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 2.1
>            Reporter: Taras Ledkov
>            Assignee: Taras Ledkov
>             Fix For: 2.3
>
>
> *Root cause*: cache name is used instead of schema name at the {{CacheQueryPartitionInfo}}
> *Reproducer*: please add the short test to the tests class {{SqlSchemaSelfTest}}
> {code}
>     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());
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message