if (data[0] == null) {
return null;
}
if (dataType.isDateTimeType()) {
DateTimeType type = (DateTimeType) dataType;
if (nodes.length > 1 && nodes[1] != null) {
if (data[1] == null) {
return null;
}
interval = HsqlDateTime.toStandardIntervalPart(
(String) data[1]);
}
if (interval < 0) {
throw Error.error(ErrorCode.X_42566, (String) data[1]);
}
return funcType == FUNC_ROUND
? type.round(data[0], interval)
: type.truncate(data[0], interval);
}
}
// fall through
case FUNC_TRUNCATE : {