HHH-18352 Don't emulate tuple comparison with subquery if possible
This commit is contained in:
parent
1d87db4e4f
commit
3d483887c1
|
@ -539,21 +539,11 @@ public class OracleSqlAstTranslator<T extends JdbcOperation> extends SqlAstTrans
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected boolean supportsRowValueConstructorSyntaxInInList() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean supportsRowValueConstructorSyntaxInQuantifiedPredicates() {
|
protected boolean supportsRowValueConstructorSyntaxInQuantifiedPredicates() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected boolean supportsRowValueConstructorSyntaxInInSubQuery() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getFromDual() {
|
protected String getFromDual() {
|
||||||
return " from dual";
|
return " from dual";
|
||||||
|
|
|
@ -7714,14 +7714,14 @@ public abstract class AbstractSqlAstTranslator<T extends JdbcOperation> implemen
|
||||||
else if ( needsTupleComparisonEmulation( operator ) ) {
|
else if ( needsTupleComparisonEmulation( operator ) ) {
|
||||||
rhsTuple = SqlTupleContainer.getSqlTuple( rhsExpression );
|
rhsTuple = SqlTupleContainer.getSqlTuple( rhsExpression );
|
||||||
assert rhsTuple != null;
|
assert rhsTuple != null;
|
||||||
// Some DBs like Oracle support tuples only for the IN subquery predicate
|
// If the DB supports tuples in the IN list predicate, use that syntax as it's more concise
|
||||||
if ( ( operator == ComparisonOperator.EQUAL || operator == ComparisonOperator.NOT_EQUAL ) && supportsRowValueConstructorSyntaxInInSubQuery() ) {
|
if ( ( operator == ComparisonOperator.EQUAL || operator == ComparisonOperator.NOT_EQUAL ) && supportsRowValueConstructorSyntaxInInList() ) {
|
||||||
comparisonPredicate.getLeftHandExpression().accept( this );
|
comparisonPredicate.getLeftHandExpression().accept( this );
|
||||||
if ( operator == ComparisonOperator.NOT_EQUAL ) {
|
if ( operator == ComparisonOperator.NOT_EQUAL ) {
|
||||||
appendSql( " not" );
|
appendSql( " not" );
|
||||||
}
|
}
|
||||||
appendSql( " in (" );
|
appendSql( " in (" );
|
||||||
renderExpressionsAsSubquery( rhsTuple.getExpressions() );
|
rhsTuple.accept( this );
|
||||||
appendSql( CLOSE_PARENTHESIS );
|
appendSql( CLOSE_PARENTHESIS );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in New Issue