Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EAB5C17C37 for ; Mon, 29 Sep 2014 12:36:34 +0000 (UTC) Received: (qmail 84529 invoked by uid 500); 29 Sep 2014 12:36:34 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 84507 invoked by uid 500); 29 Sep 2014 12:36:34 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 84497 invoked by uid 99); 29 Sep 2014 12:36:33 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Sep 2014 12:36:33 +0000 Date: Mon, 29 Sep 2014 12:36:33 +0000 (UTC) From: "Rick Hillegas (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DERBY-6750) Query parsing seems to hang forever in ColumnReference.getSourceResultSet 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/DERBY-6750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14151640#comment-14151640 ] Rick Hillegas commented on DERBY-6750: -------------------------------------- The bug goes back to 10.6.1.0, the release which introduced the NATURAL JOIN syntax. > Query parsing seems to hang forever in ColumnReference.getSourceResultSet > ------------------------------------------------------------------------- > > Key: DERBY-6750 > URL: https://issues.apache.org/jira/browse/DERBY-6750 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.11.1.1 > Reporter: Ralf Menzel > > We have an application that programmatically generates queries. For some queries the call of Connection.prepareStatement never returns. I took one of these queries and simplified until I got the following query: > SELECT * FROM ( > SELECT 1 AS X FROM SYSIBM.SYSDUMMY1 > ) Q1 NATURAL JOIN ( > SELECT X FROM ( > SELECT 1 AS X FROM SYSIBM.SYSDUMMY1 > ) Q2 UNION SELECT X FROM ( > SELECT 2 AS X FROM SYSIBM.SYSDUMMY1 > ) Q3 > ) Q4; > When I execute this query with ij it never produces a result. > A typical stack trace of our application when it hangs starts like this: > java.lang.Exception: test timed out after 250 milliseconds > at org.apache.derby.impl.sql.compile.ColumnReference.getSourceResultSet(Unknown Source) > at org.apache.derby.impl.sql.compile.BinaryRelationalOperatorNode.getScopedOperand(Unknown Source) > at org.apache.derby.impl.sql.compile.Predicate.getPredScopedForResultSet(Unknown Source) > at org.apache.derby.impl.sql.compile.SetOperatorNode.pushOptPredicate(Unknown Source) > at org.apache.derby.impl.sql.compile.UnionNode.optimizeIt(Unknown Source) > at org.apache.derby.impl.sql.compile.ProjectRestrictNode.optimizeIt(Unknown Source) > at org.apache.derby.impl.sql.compile.OptimizerImpl.costPermutation(Unknown Source) > at org.apache.derby.impl.sql.compile.SelectNode.optimize(Unknown Source) > at org.apache.derby.impl.sql.compile.ProjectRestrictNode.optimizeIt(Unknown Source) > at org.apache.derby.impl.sql.compile.OptimizerImpl.costPermutation(Unknown Source) > at org.apache.derby.impl.sql.compile.SelectNode.optimize(Unknown Source) > at org.apache.derby.impl.sql.compile.DMLStatementNode.optimizeStatement(Unknown Source) > at org.apache.derby.impl.sql.compile.CursorNode.optimizeStatement(Unknown Source) > at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source) > at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source) > at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown Source) > at org.apache.derby.impl.jdbc.EmbedPreparedStatement.(Unknown Source) > at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.(Unknown Source) > at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.(Unknown Source) > at org.apache.derby.impl.jdbc.EmbedPreparedStatement40.(Unknown Source) > at org.apache.derby.jdbc.Driver40.newEmbedPreparedStatement(Unknown Source) > at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source) > ... -- This message was sent by Atlassian JIRA (v6.3.4#6332)