Issue 96086 - connectivity: ambiguous && || sequence
Summary: connectivity: ambiguous && || sequence
Status: CLOSED FIXED
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: DEV300m35
Hardware: All Linux, all
: P3 Trivial (vote)
Target Milestone: OOo 3.1
Assignee: Frank Schönheit
QA Contact: issues@dba
URL:
Keywords:
Depends on:
Blocks: 96084
  Show dependency tree
 
Reported: 2008-11-11 10:22 UTC by caolanm
Modified: 2009-03-23 14:04 UTC (History)
1 user (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
suspicious code (728 bytes, patch)
2008-11-11 10:23 UTC, caolanm
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description caolanm 2008-11-11 10:22:46 UTC
X && Y || Z
binds operator precedence-wise as
(X && Y) || Z
not
X && (Y || Z)

i.e. connectivity/source/parse/sqlnode.cxx has

else if(bNegate && SQL_ISRULE(pSearchCondition,comparison_predicate) ||
SQL_ISRULE(pSearchCondition,all_or_any_predicate))

which equates to

else if((bNegate && SQL_ISRULE(pSearchCondition,comparison_predicate)) ||
SQL_ISRULE(pSearchCondition,all_or_any_predicate))

which kind of looks suspicious, should it be

else if(bNegate && (SQL_ISRULE(pSearchCondition,comparison_predicate) ||
SQL_ISRULE(pSearchCondition,all_or_any_predicate)))

? I kind of suspect should be, patch attached to do that.
Comment 1 caolanm 2008-11-11 10:23:14 UTC
Created attachment 57867 [details]
suspicious code
Comment 2 Frank Schönheit 2008-11-11 11:13:55 UTC
fs->oj: please check
Comment 3 ocke.janssen 2008-11-11 12:16:38 UTC
Patch applied in cws dba31f. Thanks.
Comment 4 ocke.janssen 2008-11-28 08:16:00 UTC
Please verify. Thanks.
Comment 5 Frank Schönheit 2008-12-03 08:01:04 UTC
patch made it into CWS => VERIFIED
Comment 6 caolanm 2009-03-23 14:04:53 UTC
closing, in master