Return-Path: X-Original-To: apmail-ignite-issues-archive@minotaur.apache.org Delivered-To: apmail-ignite-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4FD8218611 for ; Wed, 11 Nov 2015 13:29:11 +0000 (UTC) Received: (qmail 45870 invoked by uid 500); 11 Nov 2015 13:29:11 -0000 Delivered-To: apmail-ignite-issues-archive@ignite.apache.org Received: (qmail 45833 invoked by uid 500); 11 Nov 2015 13:29:11 -0000 Mailing-List: contact issues-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list issues@ignite.apache.org Received: (qmail 45819 invoked by uid 99); 11 Nov 2015 13:29:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Nov 2015 13:29:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id EE94A2C14F8 for ; Wed, 11 Nov 2015 13:29:10 +0000 (UTC) Date: Wed, 11 Nov 2015 13:29:10 +0000 (UTC) From: "Sergi Vladykin (JIRA)" To: issues@ignite.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (IGNITE-1886) NPE in H2 when running query with subselects MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/IGNITE-1886?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15000357#comment-15000357 ] Sergi Vladykin commented on IGNITE-1886: ---------------------------------------- Where is the test? > NPE in H2 when running query with subselects > -------------------------------------------- > > Key: IGNITE-1886 > URL: https://issues.apache.org/jira/browse/IGNITE-1886 > Project: Ignite > Issue Type: Bug > Components: cache > Reporter: Valentin Kulichenko > Assignee: Sergi Vladykin > Priority: Critical > Fix For: 1.5 > > > Test reproducing the issue is attached. NPE is thrown as a result (see below). > Corresponding user@ thread: http://apache-ignite-users.70518.x6.nabble.com/Does-Ignite-support-nested-SQL-Queries-td1714.html > {noformat} > Exception in thread "main" javax.cache.CacheException: class org.apache.ignite.IgniteException: Failed to parse query: SELECT a.* FROM (SELECT CASE WHEN u.id < 100 THEN u.id ELSE ug.id END id FROM "UserCache".user u, userorder ug WHERE u.id = ug.usrid) a, (SELECT CASE WHEN og.goodid < 5 THEN 100 ELSE og.goodid END id FROM userorder ug, "OrderGoodCache".ordergood og WHERE ug.id = og.orderid) b WHERE a.id = b.id > at org.apache.ignite.internal.processors.cache.IgniteCacheProxy.query(IgniteCacheProxy.java:636) > at org.apache.ignite.examples.ExampleNodeStartup.main(ExampleNodeStartup.java:70) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140) > Caused by: class org.apache.ignite.IgniteException: Failed to parse query: SELECT a.* FROM (SELECT CASE WHEN u.id < 100 THEN u.id ELSE ug.id END id FROM "UserCache".user u, userorder ug WHERE u.id = ug.usrid) a, (SELECT CASE WHEN og.goodid < 5 THEN 100 ELSE og.goodid END id FROM userorder ug, "OrderGoodCache".ordergood og WHERE ug.id = og.orderid) b WHERE a.id = b.id > at org.apache.ignite.internal.processors.query.GridQueryProcessor.queryTwoStep(GridQueryProcessor.java:641) > at org.apache.ignite.internal.processors.cache.IgniteCacheProxy.query(IgniteCacheProxy.java:627) > ... 6 more > Caused by: class org.apache.ignite.IgniteCheckedException: Failed to parse query: SELECT a.* FROM (SELECT CASE WHEN u.id < 100 THEN u.id ELSE ug.id END id FROM "UserCache".user u, userorder ug WHERE u.id = ug.usrid) a, (SELECT CASE WHEN og.goodid < 5 THEN 100 ELSE og.goodid END id FROM userorder ug, "OrderGoodCache".ordergood og WHERE ug.id = og.orderid) b WHERE a.id = b.id > at org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:1510) > at org.apache.ignite.internal.processors.query.GridQueryProcessor.queryTwoStep(GridQueryProcessor.java:634) > ... 7 more > Caused by: javax.cache.CacheException: Failed to parse query: SELECT a.* FROM (SELECT CASE WHEN u.id < 100 THEN u.id ELSE ug.id END id FROM "UserCache".user u, userorder ug WHERE u.id = ug.usrid) a, (SELECT CASE WHEN og.goodid < 5 THEN 100 ELSE og.goodid END id FROM userorder ug, "OrderGoodCache".ordergood og WHERE ug.id = og.orderid) b WHERE a.id = b.id > at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.queryTwoStep(IgniteH2Indexing.java:938) > at org.apache.ignite.internal.processors.query.GridQueryProcessor$4.applyx(GridQueryProcessor.java:636) > at org.apache.ignite.internal.processors.query.GridQueryProcessor$4.applyx(GridQueryProcessor.java:634) > at org.apache.ignite.internal.util.lang.IgniteOutClosureX.apply(IgniteOutClosureX.java:36) > at org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:1492) > ... 8 more > Caused by: org.h2.jdbc.JdbcSQLException: General error: "java.lang.NullPointerException" [50000-175] > at org.h2.message.DbException.getJdbcSQLException(DbException.java:332) > at org.h2.message.DbException.get(DbException.java:161) > at org.h2.message.DbException.convert(DbException.java:284) > at org.h2.message.DbException.toSQLException(DbException.java:257) > at org.h2.message.TraceObject.logAndConvert(TraceObject.java:368) > at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:270) > at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.queryTwoStep(IgniteH2Indexing.java:935) > ... 12 more > Caused by: java.lang.NullPointerException > at org.h2.expression.Function.getCost(Function.java:2391) > at org.h2.expression.Comparison.getCost(Comparison.java:480) > at org.h2.expression.ConditionAndOr.optimize(ConditionAndOr.java:133) > at org.h2.expression.ConditionAndOr.optimize(ConditionAndOr.java:131) > at org.h2.command.dml.Select.prepare(Select.java:813) > at org.h2.command.Parser.prepare(Parser.java:220) > at org.h2.engine.Session.prepare(Session.java:403) > at org.h2.index.ViewIndex.getCost(ViewIndex.java:159) > at org.h2.table.TableView.getBestPlanItem(TableView.java:210) > at org.h2.table.TableFilter.getBestPlanItem(TableFilter.java:184) > at org.h2.table.Plan.calculateCost(Plan.java:111) > at org.h2.command.dml.Optimizer.testPlan(Optimizer.java:177) > at org.h2.command.dml.Optimizer.calculateBruteForceAll(Optimizer.java:106) > at org.h2.command.dml.Optimizer.calculateBestPlan(Optimizer.java:83) > at org.h2.command.dml.Optimizer.optimize(Optimizer.java:230) > at org.h2.command.dml.Select.preparePlan(Select.java:933) > at org.h2.command.dml.Select.prepare(Select.java:834) > at org.h2.command.Parser.prepareCommand(Parser.java:240) > at org.h2.engine.Session.prepareLocal(Session.java:436) > at org.h2.engine.Session.prepareCommand(Session.java:379) > at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1138) > at org.h2.jdbc.JdbcPreparedStatement.(JdbcPreparedStatement.java:70) > at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:267) > ... 13 more > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)