File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed
main/java/net/sf/jsqlparser/statement/select
test/java/net/sf/jsqlparser/statement/select Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ public String toString() {
195195 if (isSimple () && isOuter ()) {
196196 return "OUTER " + rightItem ;
197197 } else if (isSimple ()) {
198- return "" + rightItem ;
198+ return ", " + rightItem ;
199199 } else {
200200 String type = "" ;
201201
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ public String toString() {
6565 StringBuilder sb = new StringBuilder ();
6666 sb .append ("(" ).append (left );
6767 for (Join j : joinList ) {
68- sb .append (" " ).append (j );
68+ sb .append (j . isSimple () ? "" : " " ).append (j );
6969 }
7070
7171 sb .append (")" ).append ((alias != null ) ? (" " + alias .toString ()) : "" ).append ((pivot != null ) ? " " + pivot : "" );
Original file line number Diff line number Diff line change @@ -2009,6 +2009,12 @@ public void testWithStatement() throws JSQLParserException {
20092009 assertSqlCanBeParsedAndDeparsed (stmt );
20102010 }
20112011
2012+ @ Test
2013+ public void testSubjoinWithJoins () throws JSQLParserException {
2014+ String stmt = "SELECT COUNT(DISTINCT `webProduct`.`id`) FROM (`webProduct`, `base`, `protectedBase`)" ;
2015+ assertSqlCanBeParsedAndDeparsed (stmt );
2016+ }
2017+
20122018 @ Test
20132019 public void testWithUnionProblem () throws JSQLParserException {
20142020 String stmt = "WITH test AS ((SELECT mslink FROM tablea) UNION (SELECT mslink FROM tableb)) SELECT * FROM tablea WHERE mslink IN (SELECT mslink FROM test)" ;
You can’t perform that action at this time.
0 commit comments