File tree 3 files changed +22
-7
lines changed
java/net/sf/jsqlparser/expression
jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/expression
3 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -65,11 +65,11 @@ public String toString() {
65
65
}
66
66
b .append (connectExpression .toString ());
67
67
if (startExpression != null ) {
68
- b .append (" START WITH " ).append (startExpression . toString () );
68
+ b .append (" START WITH " ).append (startExpression );
69
69
}
70
70
} else {
71
71
if (startExpression != null ) {
72
- b .append (" START WITH " ).append (startExpression . toString () );
72
+ b .append (" START WITH " ).append (startExpression );
73
73
}
74
74
b .append (" CONNECT BY " );
75
75
if (isNoCycle ()) {
Original file line number Diff line number Diff line change @@ -3865,20 +3865,20 @@ OracleHierarchicalExpression OracleHierarchicalQueryClause():
3865
3865
{
3866
3866
(
3867
3867
(
3868
- <K_START> <K_WITH> expr=AndExpression () {result.setStartExpression(expr);}
3869
- <K_CONNECT> <K_BY> [ <K_NOCYCLE> { result.setNoCycle(true); } ] expr=AndExpression ()
3868
+ <K_START> <K_WITH> expr=XorExpression () {result.setStartExpression(expr);}
3869
+ <K_CONNECT> <K_BY> [ <K_NOCYCLE> { result.setNoCycle(true); } ] expr=XorExpression ()
3870
3870
{
3871
3871
result.setConnectExpression(expr);
3872
3872
}
3873
3873
)
3874
3874
|
3875
3875
(
3876
- <K_CONNECT> <K_BY> [ <K_NOCYCLE> { result.setNoCycle(true); } ] expr=AndExpression ()
3876
+ <K_CONNECT> <K_BY> [ <K_NOCYCLE> { result.setNoCycle(true); } ] expr=XorExpression ()
3877
3877
{
3878
3878
result.setConnectExpression(expr);
3879
3879
result.setConnectFirst(true);
3880
3880
}
3881
- [ LOOKAHEAD(2) <K_START> <K_WITH> expr=AndExpression () {result.setStartExpression(expr);} ]
3881
+ [ LOOKAHEAD(2) <K_START> <K_WITH> expr=XorExpression () {result.setStartExpression(expr);} ]
3882
3882
)
3883
3883
)
3884
3884
{
@@ -6643,7 +6643,7 @@ TableFunction TableFunction():
6643
6643
{
6644
6644
[ prefix = <K_LATERAL> ]
6645
6645
function=Function()
6646
- [ <K_WITH> ( withClause = <K_OFFSET> | withClause = <K_ORDINALITY> ) ]
6646
+ [ LOOKAHEAD(2) <K_WITH> ( withClause = <K_OFFSET> | withClause = <K_ORDINALITY> ) ]
6647
6647
{
6648
6648
return prefix!=null
6649
6649
? withClause!=null
Original file line number Diff line number Diff line change
1
+ package net .sf .jsqlparser .expression ;
2
+
3
+ import net .sf .jsqlparser .JSQLParserException ;
4
+ import net .sf .jsqlparser .test .TestUtils ;
5
+ import org .junit .jupiter .api .Test ;
6
+
7
+ class OracleHierarchicalExpressionTest {
8
+
9
+ @ Test
10
+ void testIssue2231 () throws JSQLParserException {
11
+ String sqlString =
12
+ "select name from product where level > 1 start with 1 = 1 or 1 = 2 connect by nextversion = prior activeversion" ;
13
+ TestUtils .assertSqlCanBeParsedAndDeparsed (sqlString , true );
14
+ }
15
+ }
You can’t perform that action at this time.
0 commit comments