pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #7574: CASE in WHERE condition change result set
2+ messages / 2 participants
[nested] [flat]

* BUG #7574: CASE in WHERE condition change result set
@ 2012-09-28 08:58  urvancevav@gmail.com
  0 siblings, 1 reply; 2+ messages in thread

From: urvancevav@gmail.com @ 2012-09-28 08:58 UTC (permalink / raw)
  To: pgsql-bugs

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.





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #7574: CASE in WHERE condition change result set
@ 2012-10-02 03:59  Alvaro Herrera <alvherre@2ndquadrant.com>
  parent: urvancevav@gmail.com
  0 siblings, 0 replies; 2+ messages in thread

From: Alvaro Herrera @ 2012-10-02 03:59 UTC (permalink / raw)
  To: urvancevav <urvancevav@gmail.com>; +Cc: pgsql-bugs

Excerpts from urvancevav's message of vie sep 28 05:58:42 -0300 2012:
> 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:

> [ snipped ]

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

Can you please provide a complete example?  That would be something that
someone else can load into an empty database and observe the failure.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2012-10-02 03:59 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-09-28 08:58 BUG #7574: CASE in WHERE condition change result set urvancevav@gmail.com
2012-10-02 03:59 ` Alvaro Herrera <alvherre@2ndquadrant.com>

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