Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 97452 invoked from network); 7 Nov 2006 04:05:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Nov 2006 04:05:07 -0000 Received: (qmail 15114 invoked by uid 500); 7 Nov 2006 04:05:17 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 15086 invoked by uid 500); 7 Nov 2006 04:05:17 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 15075 invoked by uid 99); 7 Nov 2006 04:05:17 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Nov 2006 20:05:17 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of kartha02@gmail.com designates 66.249.92.169 as permitted sender) Received: from [66.249.92.169] (HELO ug-out-1314.google.com) (66.249.92.169) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Nov 2006 20:05:02 -0800 Received: by ug-out-1314.google.com with SMTP id a2so968176ugf for ; Mon, 06 Nov 2006 20:04:40 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:x-accept-language:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=GnvSBnDXjdNiyN+pniU7xTlUQmYXTtGuKlGGYqB0Sja7tzgU42/dZOOj5aKmzZ7+fj9hWk1E1vj9b0vI5vzeoghmFM6ddGCATpyeDPL6DVXYY25PFRc6mrXIyi3oVcHNmFbmfAgI8rS3YqIoYVeB6X/B1TrwT0MAE7o1h4ckTlM= Received: by 10.78.160.2 with SMTP id i2mr7696618hue.1162872280605; Mon, 06 Nov 2006 20:04:40 -0800 (PST) Received: from ?192.168.0.2? ( [24.6.28.116]) by mx.google.com with ESMTP id 4sm6418061hud.2006.11.06.20.04.38; Mon, 06 Nov 2006 20:04:40 -0800 (PST) Message-ID: <45500596.2020306@gmail.com> Date: Mon, 06 Nov 2006 20:03:34 -0800 From: Rajesh Kartha User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Derby Discussion Subject: Re: StackOverflowError References: <000401c70206$9c72b150$8700a8c0@referentia.com> In-Reply-To: <000401c70206$9c72b150$8700a8c0@referentia.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hello Jim, Is it possible to try this query out with the latest GA release 10.2.1.6 ? http://db.apache.org/derby/derby_downloads.html#Latest+Official+Release There have been some fixes in the related code generation areas for 10.2: DERBY-766, DERBY-1714 etc. Also, can post the schema that can reproduce this issue ? Regards, Rajesh Jim Newsham wrote: >Hi everyone, > >I thought the problem would go away if I gave Derby a better written query, >so I fixed my query generator to be a bit smarter. Unfortunately, I still >get a stack overflow error. Here's the new query: > >ij(SAMPLEBASE)> select count(*) from time where time.id in (select time.id >from time, double_sample, band where band.id = double_sample.fk_band_id and >double_sample.fk_time_id = time.id and (band.id = 39 or band.id = 55)); >1 >----------- >ERROR 38000: The exception 'java.lang.StackOverflowError' was thrown while >evaluating an expression. SQLSTATE: XJ001: Java exception: ': >java.lang.StackOverflowError'. > > >This looks like an ugly bug for such a simple query. I didn't find any bug >in jira which seemed to relate to this. Is this a known bug? > >Any advice on how to work around the problem is appreciated. > >I'm using Derby 10.1.3.1. > >Thanks, >Jim > >P.S. I just included the outer query ("select count(*) from..") to >reproduce the problem in ij. My program actually uses jdbc, executes the >inner query, and calls ResultSet.last(). The result is the same, a >StackOverflowError. Here's the stack trace I get in my app: > >Caused by: org.apache.derby.client.am.SqlException: The exception >'java.lang.StackOverflowError' was thrown while evaluating an expression. >SQLSTATE: XJ001: Java exception: ': java.lang.StackOverflowError'. > at org.apache.derby.client.am.ResultSet.completeSqlca(Unknown >Source) > at >org.apache.derby.client.net.NetResultSetReply.parseFetchError(Unknown > Source) > at >org.apache.derby.client.net.NetResultSetReply.parseCNTQRYreply(Unknown >Source) > at >org.apache.derby.client.net.NetResultSetReply.readPositioningFetch(Unknown >Source) > at >org.apache.derby.client.net.ResultSetReply.readPositioningFetch(Unknown >Source) > at >org.apache.derby.client.net.NetResultSet.readPositioningFetch_(Unknown >Source) > at org.apache.derby.client.am.ResultSet.getRowCount(Unknown Source) > at org.apache.derby.client.am.ResultSet.lastX(Unknown Source) > at org.apache.derby.client.am.ResultSet.last(Unknown Source) > at >com.referentia.sdf.monitor.samplebase.derby.QueryDataSet.getSize(QueryDataSe >t.java:139) > > > > >>-----Original Message----- >>From: Jim Newsham [mailto:jnewsham@referentia.com] >>Sent: Monday, November 06, 2006 11:21 AM >>To: 'Derby Discussion' >>Subject: StackOverflowError >> >> >>Any reason why I should get a stack overflow error with the following >>query? >> >>Yes, I know the query is a bit odd... it's not hand-written. The query >>generator could be optimized. Nevertheless... is the stack overflow here >>considered a bug or a limitation? If limitation, what specifically is the >>limitation? >> >> >>ij(SAMPLEBASE)> select count(*) from time where time.id in (select time.id >>from time, double_sample, band where band.id = double_sample.fk_band_id >>and >>double_sample.fk_time_id = time.id and band.id = 57 union select id from >>time where 1 = 0); >>1 >>----------- >>ERROR 38000: The exception 'java.lang.StackOverflowError' was thrown while >>evaluating an expression. SQLSTATE: XJ001: Java exception: ': >>java.lang.StackOverflowError'. >> >>Thanks, >>Jim >> >> >> >> > > > > > >