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() {
195
195
if (isSimple () && isOuter ()) {
196
196
return "OUTER " + rightItem ;
197
197
} else if (isSimple ()) {
198
- return "" + rightItem ;
198
+ return ", " + rightItem ;
199
199
} else {
200
200
String type = "" ;
201
201
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ public String toString() {
65
65
StringBuilder sb = new StringBuilder ();
66
66
sb .append ("(" ).append (left );
67
67
for (Join j : joinList ) {
68
- sb .append (" " ).append (j );
68
+ sb .append (j . isSimple () ? "" : " " ).append (j );
69
69
}
70
70
71
71
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 {
2009
2009
assertSqlCanBeParsedAndDeparsed (stmt );
2010
2010
}
2011
2011
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
+
2012
2018
@ Test
2013
2019
public void testWithUnionProblem () throws JSQLParserException {
2014
2020
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