@@ -7643,9 +7643,6 @@ public void visitInListPredicate(InListPredicate inListPredicate) {
76437643 .getExpressions ().get ( 0 );
76447644 }
76457645 else if ( !dialect .supportsRowValueConstructorSyntaxInInList () ) {
7646- final ComparisonOperator comparisonOperator = inListPredicate .isNegated () ?
7647- ComparisonOperator .NOT_EQUAL :
7648- ComparisonOperator .EQUAL ;
76497646 // Some DBs like Oracle support tuples only for the IN subquery predicate
76507647 if ( dialect .supportsRowValueConstructorSyntaxInInSubQuery () && dialect .supportsUnionAll () ) {
76517648 inListPredicate .getTestExpression ().accept ( this );
@@ -7664,20 +7661,21 @@ else if ( !dialect.supportsRowValueConstructorSyntaxInInList() ) {
76647661 appendSql ( CLOSE_PARENTHESIS );
76657662 }
76667663 else {
7667- if (inListPredicate .isNegated ()) {
7668- appendSql ("not " );
7669- }
7664+ final ComparisonOperator tupleComparisonOperator = inListPredicate .isNegated () ?
7665+ ComparisonOperator .NOT_EQUAL :
7666+ ComparisonOperator .EQUAL ;
7667+ final String expressionJunction = inListPredicate .isNegated () ? " and " : " or " ;
76707668 appendSql ( OPEN_PARENTHESIS );
76717669 String separator = NO_SEPARATOR ;
76727670 for (Expression expression : listExpressions ) {
76737671 appendSql (separator );
76747672 emulateTupleComparison (
76757673 lhsTuple .getExpressions (),
76767674 SqlTupleContainer .getSqlTuple (expression ).getExpressions (),
7677- ComparisonOperator . EQUAL ,
7675+ tupleComparisonOperator ,
76787676 true
76797677 );
7680- separator = " or " ;
7678+ separator = expressionJunction ;
76817679 }
76827680 appendSql ( CLOSE_PARENTHESIS );
76837681 }
0 commit comments