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:
12771277 )
12781278
12791279 {
1280- if (selects.size()==1 && selects.get(0) instanceof PlainSelect) {
1280+ if (selects.size()==1 && selects.get(0) instanceof PlainSelect && orderByElements==null ) {
12811281 if (brackets.get(0))
1282- ((PlainSelect)selects.get(0)).setUseBrackets(true);
1282+ ((PlainSelect)selects.get(0)).setUseBrackets(true);
12831283 return selects.get(0);
12841284 } else {
12851285 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 {
36293629 public void testSubQueryAliasIssue754 () throws JSQLParserException {
36303630 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" );
36313631 }
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+ }
36323637}
You can’t perform that action at this time.
0 commit comments