Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-6288

NPE on SQL query with parameters on custom schema name

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.1
    • 2.3
    • sql
    • None

    Description

      Root cause: cache name is used instead of schema name at the CacheQueryPartitionInfo

      Reproducer: please add the short test to the tests class SqlSchemaSelfTest

          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());
          }
      

      Attachments

        Issue Links

          Activity

            People

              tledkov-gridgain Taras Ledkov
              tledkov-gridgain Taras Ledkov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: