File tree Expand file tree Collapse file tree 2 files changed +7
-2
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
-2
lines changed Original file line number Diff line number Diff line change @@ -1277,9 +1277,9 @@ SelectBody SetOperationList() #SetOperationList:
1277
1277
)
1278
1278
1279
1279
{
1280
- if (selects.size()==1 && selects.get(0) instanceof PlainSelect) {
1280
+ if (selects.size()==1 && selects.get(0) instanceof PlainSelect && orderByElements==null ) {
1281
1281
if (brackets.get(0))
1282
- ((PlainSelect)selects.get(0)).setUseBrackets(true);
1282
+ ((PlainSelect)selects.get(0)).setUseBrackets(true);
1283
1283
return selects.get(0);
1284
1284
} else {
1285
1285
list.setBracketsOpsAndSelects(brackets,selects,operations);
Original file line number Diff line number Diff line change @@ -3629,4 +3629,9 @@ public void testLongQualifiedNamesIssue763_2() throws JSQLParserException {
3629
3629
public void testSubQueryAliasIssue754 () throws JSQLParserException {
3630
3630
assertSqlCanBeParsedAndDeparsed ("SELECT C0 FROM T0 INNER JOIN T1 ON C1 = C0 INNER JOIN (SELECT W1 FROM T2) S1 ON S1.W1 = C0 ORDER BY C0" );
3631
3631
}
3632
+
3633
+ @ Test
3634
+ public void testSubQueryOrderByIssue705 () throws JSQLParserException {
3635
+ assertSqlCanBeParsedAndDeparsed ("SELECT a.* FROM ((SELECT T1.SACOJA FROM SOLARB t1) ORDER BY sacoja ASC) a" );
3636
+ }
3632
3637
}
You can’t perform that action at this time.
0 commit comments