Allow java parameter replace entire IN expression

This commit is contained in:
aboyko
2025-03-16 11:50:14 -04:00
parent e696e8355b
commit 9c4aa052d4
10 changed files with 7707 additions and 7553 deletions

View File

@@ -2531,6 +2531,7 @@ expression
predicate
: predicate NOT? IN '(' (selectStatement | expressions) ')' # inPredicate
| predicate NOT? IN parameter # inPredicateWithParameter
| predicate IS nullNotnull # isNullPredicate
| left = predicate comparisonOperator right = predicate # binaryComparisonPredicate
| predicate comparisonOperator quantifier = (ALL | ANY | SOME) '(' selectStatement ')' # subqueryComparisonPredicate

View File

@@ -4044,6 +4044,7 @@ trim_list
in_expr
: select_with_parens # in_expr_select
| OPEN_PAREN expr_list CLOSE_PAREN # in_expr_list
| parameter # in_parameter
;
case_expr

View File

@@ -7020,6 +7020,18 @@ public class MySqlParserBaseListener implements MySqlParserListener {
* <p>The default implementation does nothing.</p>
*/
@Override public void exitInPredicate(MySqlParser.InPredicateContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterInPredicateWithParameter(MySqlParser.InPredicateWithParameterContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitInPredicateWithParameter(MySqlParser.InPredicateWithParameterContext ctx) { }
/**
* {@inheritDoc}
*

View File

@@ -6409,6 +6409,18 @@ public interface MySqlParserListener extends ParseTreeListener {
* @param ctx the parse tree
*/
void exitInPredicate(MySqlParser.InPredicateContext ctx);
/**
* Enter a parse tree produced by the {@code inPredicateWithParameter}
* labeled alternative in {@link MySqlParser#predicate}.
* @param ctx the parse tree
*/
void enterInPredicateWithParameter(MySqlParser.InPredicateWithParameterContext ctx);
/**
* Exit a parse tree produced by the {@code inPredicateWithParameter}
* labeled alternative in {@link MySqlParser#predicate}.
* @param ctx the parse tree
*/
void exitInPredicateWithParameter(MySqlParser.InPredicateWithParameterContext ctx);
/**
* Enter a parse tree produced by the {@code betweenPredicate}
* labeled alternative in {@link MySqlParser#predicate}.

View File

@@ -7898,6 +7898,18 @@ public class PostgreSqlParserBaseListener implements PostgreSqlParserListener {
* <p>The default implementation does nothing.</p>
*/
@Override public void exitIn_expr_list(PostgreSqlParser.In_expr_listContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterIn_parameter(PostgreSqlParser.In_parameterContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitIn_parameter(PostgreSqlParser.In_parameterContext ctx) { }
/**
* {@inheritDoc}
*

View File

@@ -6589,6 +6589,18 @@ public interface PostgreSqlParserListener extends ParseTreeListener {
* @param ctx the parse tree
*/
void exitIn_expr_list(PostgreSqlParser.In_expr_listContext ctx);
/**
* Enter a parse tree produced by the {@code in_parameter}
* labeled alternative in {@link PostgreSqlParser#in_expr}.
* @param ctx the parse tree
*/
void enterIn_parameter(PostgreSqlParser.In_parameterContext ctx);
/**
* Exit a parse tree produced by the {@code in_parameter}
* labeled alternative in {@link PostgreSqlParser#in_expr}.
* @param ctx the parse tree
*/
void exitIn_parameter(PostgreSqlParser.In_parameterContext ctx);
/**
* Enter a parse tree produced by {@link PostgreSqlParser#case_expr}.
* @param ctx the parse tree