You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/09/07 16:33:02 UTC

[jira] [Commented] (IGNITE-6288) NPE on SQL query with parameters on custom schema name

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

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

GitHub user tledkov-gridgain opened a pull request:

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

    IGNITE-6288  NPE on SQL query with parameters on custom schema name

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/gridgain/apache-ignite ignite-6288

Alternatively you can review and apply these changes as the patch at:

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

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2617
    
----
commit 3dc820a3512fec65058a4a179b9f3756a2a88b38
Author: tledkov-gridgain <tl...@gridgain.com>
Date:   2017-09-07T08:55:24Z

    IGNITE-6288: add test to reproduce

commit 6271e557f4fb352ccc05b7de67e1c1a540d471e9
Author: tledkov-gridgain <tl...@gridgain.com>
Date:   2017-09-07T16:30:09Z

    IGNITE-6288: use schema name instead on cache name on table search

----


> 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.2
>            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)