Skip to content

Commit e83008e

Browse files
committed
Fix DB2 10.5 testsuite issues
1 parent b0ad374 commit e83008e

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/DB2LegacySqlAstTranslator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ protected void renderComparison(Expression lhs, ComparisonOperator operator, Exp
420420
break;
421421
}
422422
}
423-
renderComparisonEmulateDecode( lhs, operator, rhs );
423+
renderComparisonEmulateDecode( lhs, operator, rhs, SqlAstNodeRenderingMode.NO_UNTYPED );
424424
}
425425
}
426426

hibernate-core/src/main/java/org/hibernate/dialect/DB2Dialect.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ public SqmMultiTableInsertStrategy getFallbackSqmInsertStrategy(
862862

863863
@Override
864864
public boolean supportsIsTrue() {
865-
return true;
865+
return getDB2Version().isSameOrAfter( 11 );
866866
}
867867

868868
@Override

hibernate-core/src/main/java/org/hibernate/dialect/DB2SqlAstTranslator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ protected void renderComparison(Expression lhs, ComparisonOperator operator, Exp
444444
break;
445445
}
446446
}
447-
renderComparisonEmulateDecode( lhs, operator, rhs );
447+
renderComparisonEmulateDecode( lhs, operator, rhs, SqlAstNodeRenderingMode.NO_UNTYPED );
448448
}
449449
}
450450

hibernate-core/src/main/java/org/hibernate/sql/ast/spi/AbstractSqlAstTranslator.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3625,17 +3625,25 @@ protected void renderComparisonDistinctOperator(Expression lhs, ComparisonOperat
36253625
}
36263626

36273627
protected void renderComparisonEmulateDecode(Expression lhs, ComparisonOperator operator, Expression rhs) {
3628+
renderComparisonEmulateDecode( lhs, operator, rhs, SqlAstNodeRenderingMode.DEFAULT );
3629+
}
3630+
3631+
protected void renderComparisonEmulateDecode(
3632+
Expression lhs,
3633+
ComparisonOperator operator,
3634+
Expression rhs,
3635+
SqlAstNodeRenderingMode firstArgRenderingMode) {
36283636
switch ( operator ) {
36293637
case DISTINCT_FROM:
36303638
appendSql( "decode(" );
3631-
lhs.accept( this );
3639+
render( lhs, firstArgRenderingMode );
36323640
appendSql( ',' );
36333641
rhs.accept( this );
36343642
appendSql( ",0,1)=1" );
36353643
break;
36363644
case NOT_DISTINCT_FROM:
36373645
appendSql( "decode(" );
3638-
lhs.accept( this );
3646+
render( lhs, firstArgRenderingMode );
36393647
appendSql( ',' );
36403648
rhs.accept( this );
36413649
appendSql( ",0,1)=0" );

0 commit comments

Comments
 (0)