Issue Details (XML | Word | Printable)

Key: CORE-3337
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Unassigned
Reporter: mauro russo
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Firebird Core

problem in performing case statement

Created: 05/Feb/11 12:35 PM   Updated: 07/Feb/11 08:53 AM
Component/s: Engine
Affects Version/s: 2.1.1
Fix Version/s: None

Time Tracking:
Not Specified

Planning Status: Unspecified


 Description  « Hide
the query

select distinct (case NULL when NULL then 0 else 1 end) as v from RDB$DATABASE

wrongly returns 1

whereas the query

select distinct (case when NULL is NULL then 0 else 1 end) as v from RDB$DATABASE

correctly returns 0




 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Adriano dos Santos Fernandes added a comment - 05/Feb/11 02:01 PM
There is no problem here.

The first form compares NULL = NULL, which is obviously false.

The first form equivalent is:
  select distinct (case when NULL = NULL then 0 else 1 end) as v from RDB$DATABASE

Adriano dos Santos Fernandes made changes - 05/Feb/11 02:01 PM
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Resolution Won't Fix [ 2 ]
Paul Vinkenoog added a comment - 06/Feb/11 11:08 AM

Pavel Cisar made changes - 07/Feb/11 08:53 AM
Status Resolved [ 5 ] Closed [ 6 ]