Skip to content

Commit 2335ed1

Browse files
Fixes #1369 (#1370)
* Issue1369 * Add test
1 parent cbffe6b commit 2335ed1

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/main/java/net/sf/jsqlparser/statement/select/WithItem.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public void setRecursive(boolean recursive) {
8989
}
9090

9191
public SubSelect getSubSelect() {
92-
return subSelect.withUseBrackets(false);
92+
return subSelect;
9393
}
9494

9595
public void setSubSelect(SubSelect subSelect) {

src/test/java/net/sf/jsqlparser/statement/select/SelectTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4847,7 +4847,7 @@ public void testReservedKeywordsIssue1352() throws JSQLParserException {
48474847
assertSqlCanBeParsedAndDeparsed(
48484848
"SELECT fulltext from fulltext.fulltext", true);
48494849
}
4850-
4850+
48514851
@Test
48524852
public void testTableSpaceKeyword() throws JSQLParserException {
48534853
// without extra brackets
@@ -4883,4 +4883,10 @@ public void testTableSpecificAllColumnsIssue1346() throws JSQLParserException {
48834883
assertSqlCanBeParsedAndDeparsed(
48844884
"SELECT count(a.*) from a", true);
48854885
}
4886+
4887+
@Test
4888+
public void testCanCallSubSelectOnWithItemEvenIfNotSetIssue1369() {
4889+
WithItem item = new WithItem();
4890+
assertThat(item.getSubSelect()).isNull();
4891+
}
48864892
}

0 commit comments

Comments
 (0)