[#4481] Added a comment explaining the rationale

This commit is contained in:
lukaseder 2015-08-20 11:54:01 +02:00
parent 25da0703a8
commit 9cd9867f89
2 changed files with 6 additions and 0 deletions

View File

@ -96,6 +96,9 @@ class DateDiff extends AbstractFunction<Integer> {
xx [/pro] */
case CUBRID:
case POSTGRES:
// [#4481] Parentheses are important in case this expression is
// placed in the context of other arithmetic
return field("({0} - {1})", getDataType(), date1, date2);
/* [pro] xx

View File

@ -106,6 +106,9 @@ class TimestampDiff extends AbstractFunction<DayToSecond> {
xxxx xxxxxxx
xx [/pro] */
case POSTGRES:
// [#4481] Parentheses are important in case this expression is
// placed in the context of other arithmetic
return field("({0} - {1})", getDataType(), timestamp1, timestamp2);
// CUBRID's datetime operations operate on a millisecond level