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 BA51F109AB for ; Wed, 19 Feb 2014 18:56:46 +0000 (UTC) Received: (qmail 22774 invoked by uid 500); 19 Feb 2014 18:56:37 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 22549 invoked by uid 500); 19 Feb 2014 18:56:33 -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 22275 invoked by uid 99); 19 Feb 2014 18:56:27 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Feb 2014 18:56:27 +0000 Date: Wed, 19 Feb 2014 18:56:27 +0000 (UTC) From: "Mike Matrigali (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (DERBY-6408) EXISTS returns NULL instead of FALSE 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-6408?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mike Matrigali updated DERBY-6408: ---------------------------------- Affects Version/s: 10.7.1.1 tried and reproduced against latest 10.7 branch: ij version 10.7 CONNECTION0* - jdbc:derby:wombat * = current connection ij> create table t(x int); 0 rows inserted/updated/deleted ij> values exists(select * from t); 1 ----- NULL 1 row selected > EXISTS returns NULL instead of FALSE > ------------------------------------ > > Key: DERBY-6408 > URL: https://issues.apache.org/jira/browse/DERBY-6408 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.7.1.1, 10.8.3.3, 10.9.2.2, 10.10.1.1 > Reporter: Knut Anders Hatlen > > The reference manual topic on Boolean expressions - http://db.apache.org/derby/docs/10.10/ref/rrefsqlj23075.html - says that EXISTS should return FALSE if the subquery returns no rows. In reality, it returns NULL: > ij> create table t(x int); > 0 rows inserted/updated/deleted > ij> values exists(select * from t); > 1 > ----- > NULL > 1 row selected > SQL:2011, part 2, 8.10 also says that FALSE is the correct result if the cardinality is 0. -- This message was sent by Atlassian JIRA (v6.1.5#6160)