Skip to content

Commit

Permalink
Fix DB2 10.5 testsuite issues
Browse files Browse the repository at this point in the history
  • Loading branch information
beikov committed Jul 25, 2023
1 parent b0ad374 commit e83008e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ protected void renderComparison(Expression lhs, ComparisonOperator operator, Exp
break;
}
}
renderComparisonEmulateDecode( lhs, operator, rhs );
renderComparisonEmulateDecode( lhs, operator, rhs, SqlAstNodeRenderingMode.NO_UNTYPED );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ public SqmMultiTableInsertStrategy getFallbackSqmInsertStrategy(

@Override
public boolean supportsIsTrue() {
return true;
return getDB2Version().isSameOrAfter( 11 );
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ protected void renderComparison(Expression lhs, ComparisonOperator operator, Exp
break;
}
}
renderComparisonEmulateDecode( lhs, operator, rhs );
renderComparisonEmulateDecode( lhs, operator, rhs, SqlAstNodeRenderingMode.NO_UNTYPED );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3625,17 +3625,25 @@ protected void renderComparisonDistinctOperator(Expression lhs, ComparisonOperat
}

protected void renderComparisonEmulateDecode(Expression lhs, ComparisonOperator operator, Expression rhs) {
renderComparisonEmulateDecode( lhs, operator, rhs, SqlAstNodeRenderingMode.DEFAULT );
}

protected void renderComparisonEmulateDecode(
Expression lhs,
ComparisonOperator operator,
Expression rhs,
SqlAstNodeRenderingMode firstArgRenderingMode) {
switch ( operator ) {
case DISTINCT_FROM:
appendSql( "decode(" );
lhs.accept( this );
render( lhs, firstArgRenderingMode );
appendSql( ',' );
rhs.accept( this );
appendSql( ",0,1)=1" );
break;
case NOT_DISTINCT_FROM:
appendSql( "decode(" );
lhs.accept( this );
render( lhs, firstArgRenderingMode );
appendSql( ',' );
rhs.accept( this );
appendSql( ",0,1)=0" );
Expand Down

0 comments on commit e83008e

Please sign in to comment.