
Type: Improvement

Status: Closed

Priority: Major

Resolution: Fixed

Affects Version/s: V4.0_WD01

Fix Version/s: V4.0_CSD02

Component/s: URL Conventions

Labels:None

Environment:
[Applied]

Proposal:

Resolution:
Some questions which may be nicely addressed by additional clarifications in the URL Conventions spec...
Logical Operators:
Q1. Apart from EQ and NE (where comparison with null can be easily understood to always return TRUE or FALSE), what is the result of using GT, GE, LT, LE with one (or both arguments) being NULL?
Possible answers: (a) undefined by the spec; (b) result is NULL; (c) result is FALSE; (d) a NULL value is considered lessthan nonNULL values.
If the answer is (b) NULL, then we should define that a filter that evaluates to NULL is considered FALSE, for the purposes of determining a filter match. Since NULLs may propagate up the filter expresion tree rather quickly.
Arithmetic Operators:
Q2. What is the result of an arithmetic operator applied to one (or both) NULL operands?
Possible answers: (a) undefined by the spec; (b) NULL.
Q3. What is the ordering of numeric types for promotion when mixed types are used (e.g. if ADD is applied to Single and Decimal, what type is the result)?
Suggested answer: SByte, Int16, Int32, Int64, Decimal, Single, Double. Decimal is considered "less" than Single because Single can in nearly all implementations have a larger exponent than Decimal (so we prefer "range" over "precision" for promotion).
Q4. What is the result of a canonical function applied to one (or more) NULL parameters?
Possible answers: (a) undefined by the spec; (b) NULL; (c) depends on the function (e.g. booleanvalued functions might return FALSE).
OrderBy:
Q5. Where does NULL occur in ascending sort, and where in descending sort?
Spaces in URLs
Q6. Examples in the spec show spaces in filters. Shouldn't these be %encoded (e.g. "%20") so they are valid in URLs?
Filter Related
Q7. Which primitive types support the use of LT, LE, GT, GE? (when answering, consider in particular the binary, boolean and geo types)?
Q8. Which geo types permit the use of EQ and NE? When comparing points (e.g. latitude/longitude for GeographyPoint) is the comparison of coordinates assumed to use Decimal or Double comparison (consider that Single/Double are not usually recommended as suitable for use in database indexes due to the possibility of rounding errors affecting comparisons).
Q9. Are the LHS and RHS operands for a logical operator allowed to have different types (e.g. LHS=Decimal, RHS=Int32)? If so, then can nonstring values be compared with string values?
Q10. What is the result of division/modulo arithmetic operators where the divisor is zero? Is it undefined by the spec, null, or +/ infinity? (noting that infinity is only applicable to Single/Double).
Q11. What are the rules for the calculation of the result of modulo where one or both operands are negative?
Q12. What are the rules for scale of the results of arithmetic operators where the operands are decimal?
Q13. Which style of rounding is used by the round function (e.g. roundhalfeven)?
Q14. Does the 'length' function calculate length according to UTF8 bytes, UTF16 characters, or something else? (noting that the CSDL spec defines String as a fixedlength or variablelength sequence of UTF8 characters, we should just ensure that we have consistent rules for filters).