BUG FIX: Fix parsing of -/+ style order by prefixes.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@981630 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -699,17 +699,27 @@ private OrderByItem OrderByItem(): {
|
||||
OrderByItem.Order ordering = OrderByItem.Order.DEFAULT;
|
||||
} {
|
||||
(
|
||||
<PLUS> { ordering = OrderByItem.Order.ASCENDING; }
|
||||
| <MINUS> { ordering = OrderByItem.Order.DESCENDING; }
|
||||
)?
|
||||
(
|
||||
( <UPPER> | <LOWER> ) { functionName = getToken(0).image; } <OPEN_PAREN> fieldName=NamePart() <CLOSE_PAREN>
|
||||
| fieldName=NamePart()
|
||||
(
|
||||
(
|
||||
<PLUS> { ordering = OrderByItem.Order.ASCENDING; }
|
||||
| <MINUS> { ordering = OrderByItem.Order.DESCENDING; }
|
||||
)
|
||||
(
|
||||
( <UPPER> | <LOWER> ) { functionName = getToken(0).image; }
|
||||
<OPEN_PAREN> fieldName=NamePart() <CLOSE_PAREN>
|
||||
| fieldName=NamePart()
|
||||
)
|
||||
)
|
||||
| (
|
||||
( <UPPER> | <LOWER> ) { functionName = getToken(0).image; }
|
||||
<OPEN_PAREN> fieldName=NamePart() <CLOSE_PAREN>
|
||||
| fieldName=NamePart()
|
||||
)
|
||||
(
|
||||
<DESC> { ordering = OrderByItem.Order.DESCENDING; }
|
||||
| <ASC> { ordering = OrderByItem.Order.ASCENDING; }
|
||||
)?
|
||||
)
|
||||
LOOKAHEAD({!orderingSet}) (
|
||||
<DESC> { ordering = OrderByItem.Order.DESCENDING; }
|
||||
| <ASC> { ordering = OrderByItem.Order.ASCENDING; }
|
||||
)?
|
||||
{ return new OrderByItem(ordering, functionName, fieldName); }
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ WHERE
|
||||
HAVING
|
||||
b.firstName LIKE '%foo%'
|
||||
ORDER BY
|
||||
LOWER(lastName), firstName, birthDate DESC
|
||||
LOWER(lastName), firstName, -birthDate
|
||||
OFFSET 5
|
||||
LIMIT 10
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user