Hi Evgenij,

Although the implementation is the same in both versions, the c4780480fd  
<http://c4780480fd8364077cfe7e82be91d3cace29bb2d>commit brought additional 
limitation on number of arguments if the first argument is date/time
In 1.4.200 this Oracle-specific usage of trunc(date, datePart) 
causes INVALID_PARAMETER_COUNT_2 exception that is not what was happening 
in previous versions

If I understand correctly "regular" functions are always checked before 
mode-specific (that is kind of strange) and this makes not possible to have 
trunc(...) be "overloaded" for Oracle mode:
https://github.com/h2database/h2database/blob/master/h2/src/main/org/h2/expression/function/Function.java#L315

Don't you think it would be more convenient to check mode-specific 
functions first and then look for a regular one? Or am I missing something 
here?

--
BR,
Pavel Shaidrov


On Wednesday, January 29, 2020 at 1:15:56 PM UTC+2, Evgenij Ryazanov wrote:
>
> Hello.
>
> I guess you meant 1.4.197.
>
> This function with such parameters was never supported by H2. But H2 
> silently ignores the value of the second parameter if the first parameter 
> is a DATE, TIMESTAMP, or TIMESTAMP WITH TIME ZONE.
>
> The code for these data types is the same in both versions:
>
> https://github.com/h2database/h2database/blob/version-1.4.197/h2/src/main/org/h2/expression/Function.java#L1182
>
> https://github.com/h2database/h2database/blob/version-1.4.200/h2/src/main/org/h2/expression/function/Function.java#L1805
>
> I think you need to provide a simple compete test case.
>
> If you want to override a built-in function with own one, you need to add
> ;BUILTIN_ALIAS_OVERRIDE=TRUE
> to the connection URL.
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/e1cf3213-8b72-4588-a9f0-e274607bd922o%40googlegroups.com.

Reply via email to