Open terrajobst opened 9 years ago
From user dallmair
:
Interesting additional info: My description above is wrong. The
CASE WHEN
condition evaluates totrue
if wewrite 1=1
-- so there seems to be something else quite fishy here. Maybe it's handled correctly by the constant folding, but doesn't work correctly otherwise?
Works fine in v.Next.
Ported from CodePlex
Sample query:
The expression
r.row = '0'
evaluates correctly inSELECT
's select list, but the query's result suggests it always evaluates toFALSE
in aJOIN
condition (or isn't evaluated at all).Of course, in this example it's easy to avoid by replacing the whole
CASE WHEN
with the following logicalOR
: (r.row = '0' OR r.row = o.row
). This works as expected.