[jOOQ/jOOQ#9044] Add support for parsing single parameter numeric TRUNC() function

This commit is contained in:
Lukas Eder 2020-09-24 11:00:48 +02:00
parent d94388f1c0
commit 55763c545d

View File

@ -7918,6 +7918,10 @@ final class ParserImpl implements Parser {
parse(ctx, ')');
if (arg1.getDataType().isDateTime())
return DSL.trunc((Field) arg1, DatePart.DAY);
else if (arg1.getDataType().isNumeric())
return DSL.trunc((Field) arg1, inline(0));
// [#9044] By default, assume historic TRUNC(date) behaviour
else
return DSL.trunc((Field) arg1);
}