[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: [OASIS Issue Tracker] Commented: (ODATA-166) Inconsistent lifted operators for $filter
[ http://tools.oasis-open.org/issues/browse/ODATA-166?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=31986#action_31986 ] Michael Pizzo commented on ODATA-166: ------------------------------------- The problem with 3-value logic, or with having a different operator for null, is that it makes building predicates that account for null values much harder. For example, a query to see if a certain item had changed might build a query with a predicate checking to see if each property is equal to the previously fetched value; for example, the predicate: $filter=FirstName eq 'Matthew' and LastName eq 'Borges' and Company eq 'SAP' could easily be built by looping through the properties and writing propertyName "eq" value. Parameterized, you could write a single predicate that would work for any entity in the entityset: String.Format("FirstName eq '{0}' and LastName eq '{1}' and Company eq '{2}'", record.FirstName, record.LastName, record.Company) This works for null values of FirstName, LastName, and Company IFyou support <nullvalue> eq null. However, if you need a special "is null" operator, or if comparing null values is always unknown, you have to understand, contemplate, and write significantly more logic to deal with potential null values. > Inconsistent lifted operators for $filter > ----------------------------------------- > > Key: ODATA-166 > URL: http://tools.oasis-open.org/issues/browse/ODATA-166 > Project: OASIS Open Data Protocol (OData) TC > Issue Type: Bug > Components: OData Protocol v1.0 > Affects Versions: WD01 > Environment: [Proposed] > Reporter: Matthew Borges > Priority: Minor > Fix For: WD01 > > > I didn't see any mention of lifted operators in the working drafts. We should define how each operator behaves when one (or both) operands is null. > With that said, the V3 spec (section 2.2.3.6.1.1.5) is inconsistent with it's treatment of null: > - For equality operators, null eq null is true and null eq <anything not null> is false (i.e. the result is true or false) > - Any relational operators when compared with null are false (i.e. the result is true or false) > - This implies that null ge null and null le null is false which is inconsistent with null eq null is true > - Logical operators treat null as false (i.e. the result is true or false) > - Unary operators are null if the operand is null (i.e. in the case of not, the result is true, false, or null) -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://tools.oasis-open.org/issues/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]