File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
main/jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/statement/select Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -2046,7 +2046,7 @@ OrderByElement OrderByElement():
2046
2046
Expression columnReference = null;
2047
2047
}
2048
2048
{
2049
- columnReference = SimpleExpression ()
2049
+ columnReference = Expression ()
2050
2050
[ ( <K_ASC> | (<K_DESC> { orderByElement.setAsc(false); } )) { orderByElement.setAscDescPresent(true); } ]
2051
2051
[<K_NULLS> (
2052
2052
<K_FIRST> { orderByElement.setNullOrdering(OrderByElement.NullOrdering.NULLS_FIRST); } |
Original file line number Diff line number Diff line change @@ -1214,6 +1214,12 @@ public void testOrderByNullsFirst() throws JSQLParserException {
1214
1214
assertSqlCanBeParsedAndDeparsed (statement );
1215
1215
}
1216
1216
1217
+ @ Test
1218
+ public void testOrderByWithComplexExpression () throws JSQLParserException {
1219
+ String statement = "SELECT col FROM tbl tbl_alias ORDER BY tbl_alias.id = 1 DESC" ;
1220
+ assertSqlCanBeParsedAndDeparsed (statement );
1221
+ }
1222
+
1217
1223
@ Test
1218
1224
public void testTimestamp () throws JSQLParserException {
1219
1225
String statement = "SELECT * FROM tab1 WHERE a > {ts '2004-04-30 04:05:34.56'}" ;
You can’t perform that action at this time.
0 commit comments