Fix date_trunc function for DB2 10

This commit is contained in:
Marco Belladelli 2023-01-04 15:12:42 +01:00 committed by Christian Beikov
parent 2c724d9172
commit 9369fbd597
2 changed files with 4 additions and 2 deletions

View File

@ -312,6 +312,7 @@ public class DB2LegacyDialect extends Dialect {
functionFactory.stddevPopSamp();
functionFactory.varPopSamp();
functionFactory.varianceSamp();
functionFactory.dateTrunc();
}
else {
// Before version 11, the position function required the use of the code units
@ -327,11 +328,11 @@ public class DB2LegacyDialect extends Dialect {
functionFactory.stddevSamp_sumCount();
queryEngine.getSqmFunctionRegistry().registerAlternateKey( "var_pop", "variance" );
functionFactory.varSamp_sumCount();
functionFactory.dateTrunc_trunc();
}
functionFactory.addYearsMonthsDaysHoursMinutesSeconds();
functionFactory.yearsMonthsDaysHoursMinutesSecondsBetween();
functionFactory.dateTrunc();
functionFactory.bitLength_pattern( "length(?1)*8" );
// DB2 wants parameter operands to be casted to allow lengths bigger than 255

View File

@ -297,6 +297,7 @@ public class DB2Dialect extends Dialect {
functionFactory.stddevPopSamp();
functionFactory.varPopSamp();
functionFactory.varianceSamp();
functionFactory.dateTrunc();
}
else {
// Before version 11, the position function required the use of the code units
@ -312,11 +313,11 @@ public class DB2Dialect extends Dialect {
functionFactory.stddevSamp_sumCount();
queryEngine.getSqmFunctionRegistry().registerAlternateKey( "var_pop", "variance" );
functionFactory.varSamp_sumCount();
functionFactory.dateTrunc_trunc();
}
functionFactory.addYearsMonthsDaysHoursMinutesSeconds();
functionFactory.yearsMonthsDaysHoursMinutesSecondsBetween();
functionFactory.dateTrunc();
functionFactory.bitLength_pattern( "length(?1)*8" );
// DB2 wants parameter operands to be casted to allow lengths bigger than 255