pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: urvancevav@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #7574: CASE in WHERE condition change result set
Date: Fri, 28 Sep 2012 08:58:42 +0000
Message-ID: <E1THWPC-0005CT-UG@wrigleys.postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      7574
Logged by:          Andrei
Email address:      urvancevav@gmail.com
PostgreSQL version: 9.2.1
Operating system:   3.2.0-31-generic #50-Ubuntu SMP Fri Sep 7 16:16:45
Description:        

in query like this:
select
  departure0_.departure_id as departure1_87_,
-- a lot of other fields
-- ...
           case 
                when departure0_1_.departure_id is not null then 1 
                when departure0_.departure_id is not null then 0 
            end as clazz_ 
        from
            departure departure0_ 
        left outer join
            local_inv_departure departure0_1_ 
                on departure0_.departure_id=departure0_1_.departure_id 
        where
            case 
                when departure0_1_.departure_id is not null then 1 
                when departure0_.departure_id is not null then 0 
            end=0

CASE operator in the WHERE condition actually sets clazz_ to 0 instead of
filtering it.





view thread (2+ messages)  latest in thread

Message-ID: <E1THWPC-0005CT-UG@wrigleys.postgresql.org>
Permalink:  ../E1THWPC-0005CT-UG@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/E1THWPC-0005CT-UG@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: urvancevav@gmail.com
  Subject: Re: BUG #7574: CASE in WHERE condition change result set
  In-Reply-To: <E1THWPC-0005CT-UG@wrigleys.postgresql.org>
  References: <E1THWPC-0005CT-UG@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox