trafodion icon indicating copy to clipboard operation
trafodion copied to clipboard

[TRAFODION-3190] expression involving NULL should be treated as FALSE, not TRUE.

Open wenjun-zhu opened this issue 7 years ago • 10 comments

wenjun-zhu avatar Nov 12 '18 09:11 wenjun-zhu

Can one of the admins verify this patch?

Traf-Jenkins avatar Nov 12 '18 09:11 Traf-Jenkins

Check Test Started: https://jenkins.esgyn.com/job/Check-PR-master/3027/

Traf-Jenkins avatar Nov 12 '18 09:11 Traf-Jenkins

Can one of the admins verify this patch?

Traf-Jenkins avatar Nov 12 '18 09:11 Traf-Jenkins

Can one of the admins verify this patch?

Traf-Jenkins avatar Nov 12 '18 09:11 Traf-Jenkins

Test Passed. https://jenkins.esgyn.com/job/Check-PR-master/3027/

Traf-Jenkins avatar Nov 12 '18 13:11 Traf-Jenkins

New Check Test Started: https://jenkins.esgyn.com/job/Check-PR-master/3035/

Traf-Jenkins avatar Nov 16 '18 09:11 Traf-Jenkins

Test Passed. https://jenkins.esgyn.com/job/Check-PR-master/3035/

Traf-Jenkins avatar Nov 16 '18 13:11 Traf-Jenkins

New Check Test Started: https://jenkins.esgyn.com/job/Check-PR-master/3036/

Traf-Jenkins avatar Nov 17 '18 07:11 Traf-Jenkins

Test Passed. https://jenkins.esgyn.com/job/Check-PR-master/3036/

Traf-Jenkins avatar Nov 17 '18 10:11 Traf-Jenkins

Dave is correct. Thanks for pointing it out.

Branch clause need to evaluate the second leg if the first leg is 'not false' which means it is 'true or null'. With this change, it will branch out by treating null as false.

Similar comments were added to an earlier PR 1705 for this same jira and those comments apply here as well.

For the original issue where CASE WHEN stmt was not proceeding to ELSE leg, a change need to be added so boolean result is evaluated to at the very end of THEN clause. At that time, NULL can be treated as FALSE and control to move to ELSE part. This is same as a WHERE predicate where only at the end of predicate evaluation can one determine if the result is true or false/null.

anoopsharma00 avatar Nov 21 '18 00:11 anoopsharma00