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():
20462046 Expression columnReference = null;
20472047}
20482048{
2049- columnReference = SimpleExpression ()
2049+ columnReference = Expression ()
20502050 [ ( <K_ASC> | (<K_DESC> { orderByElement.setAsc(false); } )) { orderByElement.setAscDescPresent(true); } ]
20512051 [<K_NULLS> (
20522052 <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 {
12141214 assertSqlCanBeParsedAndDeparsed (statement );
12151215 }
12161216
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+
12171223 @ Test
12181224 public void testTimestamp () throws JSQLParserException {
12191225 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