Skip to content

Commit aae36da

Browse files
committed
refactored outer not from sqlconditions, regularconditions to condition
1 parent 1956b84 commit aae36da

File tree

2 files changed

+4
-23
lines changed

2 files changed

+4
-23
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Also I would like to know about needed examples or documentation stuff.
5555

5656
## Extensions in the latest SNAPSHOT version 2.0
5757

58+
* **change of parsing** for not within condition: outer not is represented now by NotExpression
5859
* support of named parameters for execute: **EXEC procedure @param = 'foo'**
5960
* support multivalue set statement
6061
* support of **describe**

src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2171,14 +2171,12 @@ Expression RegularCondition() #RegularCondition:
21712171
Expression result = null;
21722172
Expression leftExpression;
21732173
Expression rightExpression;
2174-
//boolean not = false;
21752174
int oracleJoin=EqualsTo.NO_ORACLE_JOIN;
21762175
int oraclePrior=EqualsTo.NO_ORACLE_PRIOR;
21772176
boolean binary = false;
21782177
}
21792178
{
21802179
[ LOOKAHEAD(2) <K_PRIOR> { oraclePrior = EqualsTo.ORACLE_PRIOR_START; }]
2181-
//[ <K_NOT> { not = true; } ]
21822180
leftExpression=ComparisonItem() { result = leftExpression; }
21832181

21842182
[ "(" "+" ")" { oracleJoin=EqualsTo.ORACLE_JOIN_RIGHT; } ]
@@ -2218,8 +2216,6 @@ Expression RegularCondition() #RegularCondition:
22182216
BinaryExpression regCond = (BinaryExpression) result;
22192217
regCond.setLeftExpression(leftExpression);
22202218
regCond.setRightExpression(rightExpression);
2221-
//if (not)
2222-
// regCond.setNot();
22232219

22242220
if (oracleJoin>0)
22252221
((SupportsOldOracleJoinSyntax)result).setOldOracleJoinSyntax(oracleJoin);
@@ -2302,19 +2298,9 @@ Expression LikeExpression() #LikeExpression:
23022298
Expression rightExpression = null;
23032299
}
23042300
{
2305-
//(
2306-
//LOOKAHEAD(3)
2307-
(
2308-
leftExpression=SimpleExpression()
2309-
[<K_NOT> { result.setNot(); } ] ( <K_LIKE> | <K_ILIKE> { result.setCaseInsensitive(true); } ) rightExpression=SimpleExpression()
2310-
[<K_ESCAPE> token=<S_CHAR_LITERAL> { result.setEscape((new StringValue(token.image)).getValue()); }]
2311-
)
2312-
/* |
2313-
(
2314-
[<K_NOT> { result.setNot(); } ] leftExpression=SimpleExpression() ( <K_LIKE> | <K_ILIKE> { result.setCaseInsensitive(true); } ) rightExpression=SimpleExpression()
2315-
[<K_ESCAPE> token=<S_CHAR_LITERAL> { result.setEscape((new StringValue(token.image)).getValue()); }]
2316-
)
2317-
)*/
2301+
leftExpression=SimpleExpression()
2302+
[<K_NOT> { result.setNot(); } ] ( <K_LIKE> | <K_ILIKE> { result.setCaseInsensitive(true); } ) rightExpression=SimpleExpression()
2303+
[<K_ESCAPE> token=<S_CHAR_LITERAL> { result.setEscape((new StringValue(token.image)).getValue()); }]
23182304
{
23192305
result.setLeftExpression(leftExpression);
23202306
result.setRightExpression(rightExpression);
@@ -2329,13 +2315,8 @@ Expression IsNullExpression():
23292315
Expression leftExpression = null;
23302316
}
23312317
{
2332-
(
2333-
/* <K_NOT> { result.setNot(true); } leftExpression=SimpleExpression()
2334-
( <K_ISNULL> { result.setUseIsNull(true); } | <K_IS> <K_NULL> )
2335-
| */
23362318
leftExpression=SimpleExpression()
23372319
(<K_ISNULL> { result.setUseIsNull(true); } | <K_IS> [<K_NOT> { result.setNot(true); } ] <K_NULL> )
2338-
)
23392320

23402321
{
23412322
result.setLeftExpression(leftExpression);
@@ -2349,7 +2330,6 @@ Expression ExistsExpression():
23492330
Expression rightExpression = null;
23502331
}
23512332
{
2352-
// [<K_NOT> { result.setNot(true); } ]
23532333
<K_EXISTS> rightExpression=SimpleExpression()
23542334
{
23552335
result.setRightExpression(rightExpression);

0 commit comments

Comments
 (0)