File tree Expand file tree Collapse 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 Expand file tree Collapse file tree 3 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -65,11 +65,11 @@ public String toString() {
6565 }
6666 b .append (connectExpression .toString ());
6767 if (startExpression != null ) {
68- b .append (" START WITH " ).append (startExpression . toString () );
68+ b .append (" START WITH " ).append (startExpression );
6969 }
7070 } else {
7171 if (startExpression != null ) {
72- b .append (" START WITH " ).append (startExpression . toString () );
72+ b .append (" START WITH " ).append (startExpression );
7373 }
7474 b .append (" CONNECT BY " );
7575 if (isNoCycle ()) {
Original file line number Diff line number Diff line change @@ -3865,20 +3865,20 @@ OracleHierarchicalExpression OracleHierarchicalQueryClause():
38653865{
38663866 (
38673867 (
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 ()
38703870 {
38713871 result.setConnectExpression(expr);
38723872 }
38733873 )
38743874 |
38753875 (
3876- <K_CONNECT> <K_BY> [ <K_NOCYCLE> { result.setNoCycle(true); } ] expr=AndExpression ()
3876+ <K_CONNECT> <K_BY> [ <K_NOCYCLE> { result.setNoCycle(true); } ] expr=XorExpression ()
38773877 {
38783878 result.setConnectExpression(expr);
38793879 result.setConnectFirst(true);
38803880 }
3881- [ LOOKAHEAD(2) <K_START> <K_WITH> expr=AndExpression () {result.setStartExpression(expr);} ]
3881+ [ LOOKAHEAD(2) <K_START> <K_WITH> expr=XorExpression () {result.setStartExpression(expr);} ]
38823882 )
38833883 )
38843884 {
@@ -6643,7 +6643,7 @@ TableFunction TableFunction():
66436643{
66446644 [ prefix = <K_LATERAL> ]
66456645 function=Function()
6646- [ <K_WITH> ( withClause = <K_OFFSET> | withClause = <K_ORDINALITY> ) ]
6646+ [ LOOKAHEAD(2) <K_WITH> ( withClause = <K_OFFSET> | withClause = <K_ORDINALITY> ) ]
66476647 {
66486648 return prefix!=null
66496649 ? 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