HHH-18892 Respect DB2 hash functions only available since version 11+

This commit is contained in:
Christian Beikov 2024-12-17 17:53:02 +01:00
parent 6f887a516a
commit 25207092c2
2 changed files with 5 additions and 3 deletions

View File

@ -457,9 +457,11 @@ public class DB2Dialect extends Dialect {
functionFactory.generateSeries_recursive( getMaximumSeriesSize(), false, true );
functionFactory.hex( "hex(?1)" );
if ( getDB2Version().isSameOrAfter( 11 ) ) {
functionFactory.sha( "hash(?1, 2)" );
functionFactory.md5( "hash(?1, 0)" );
}
}
/**
* DB2 doesn't support the {@code generate_series} function or {@code lateral} recursive CTEs,

View File

@ -2612,7 +2612,7 @@ public class FunctionTests {
@RequiresDialect(PostgreSQLDialect.class)
@RequiresDialect(MySQLDialect.class)
@RequiresDialect(OracleDialect.class)
@RequiresDialect(DB2Dialect.class)
@RequiresDialect(value = DB2Dialect.class, majorVersion = 11)
@RequiresDialect(SQLServerDialect.class)
@RequiresDialect(H2Dialect.class)
@RequiresDialect(HANADialect.class)