Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 28536 invoked from network); 14 Apr 2009 13:53:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Apr 2009 13:53:39 -0000 Received: (qmail 93499 invoked by uid 500); 14 Apr 2009 13:53:39 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 93473 invoked by uid 500); 14 Apr 2009 13:53:38 -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 93465 invoked by uid 99); 14 Apr 2009 13:53:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Apr 2009 13:53:38 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Apr 2009 13:53:37 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 3E601234C045 for ; Tue, 14 Apr 2009 06:53:15 -0700 (PDT) Message-ID: <1737113594.1239717195254.JavaMail.jira@brutus> Date: Tue, 14 Apr 2009 06:53:15 -0700 (PDT) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-4001) Sequence comparison with "ALL" does not yield correct results In-Reply-To: <1003142760.1231139864621.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-4001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12698776#action_12698776 ] Knut Anders Hatlen commented on DERBY-4001: ------------------------------------------- Bryan asked which NOT EXISTS queries lang/subqueryFlattening.sql expected to be flattened. Here are the ones I found (some of them are executed multiple times with different nullability constraints). NOT EXISTS (flattened to NOT EXISTS JOIN): SELECT COUNT(*) FROM ( SELECT ID FROM DOCS WHERE ( NOT EXISTS (SELECT ID FROM COLLS WHERE DOCS.ID = COLLS.ID AND COLLID IN (-2,1) ) ) ) AS TAB; select * from t1 where not exists (select * from t2 where t1.c1=t2.c1); NOT IN (flattened to NOT EXISTS JOIN): SELECT COUNT(*) FROM ( SELECT ID FROM DOCS WHERE ( ID NOT IN (SELECT ID FROM COLLS WHERE COLLID IN (-2,1) ) ) ) AS TAB; ALL (flattened to NOT EXISTS JOIN): SELECT count(ID) FROM DOCS WHERE ID = ALL (SELECT ID FROM COLLS WHERE COLLID IN (-2,1) ); SELECT count(ID) FROM DOCS WHERE ID < ALL (SELECT ID FROM COLLS WHERE COLLID IN (-2,1) ); SELECT count(ID) FROM DOCS WHERE ID <> ALL (SELECT ID FROM COLLS WHERE COLLID IN (-2,1) ); > Sequence comparison with "ALL" does not yield correct results > ------------------------------------------------------------- > > Key: DERBY-4001 > URL: https://issues.apache.org/jira/browse/DERBY-4001 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.3.2.1 > Environment: Windows > Reporter: Venkateswaran Iyer > Assignee: Knut Anders Hatlen > Priority: Minor > Attachments: dontFlatten.diff > > > A query involving "< ALL" does not yield the right results for decimal datatype. "< ANY" works, though. > To reproduce the issue: > % create table t1(col1 decimal(10,5)); > % insert into t1 values (-21483.64800); > % insert into t1 values (74837.00000); > % select col1 from t1 where col1 < ALL (select 0.0 from t1); > The above yields no results whereas it should return the first row. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.