Inconsitent automatic type casting for built-in scalar functions
Inconsistent behavior of automatic type casting with built-in scalar functions with numeric arguments. Almost all functions do automatic string-to-numeric type cast for arguments. Example: abs('-11') returns -11.0, sin('3.14') returns 0.002, etc...
But where are some exceptions, which are (probably) bugs. I've done some some tests with FB-3.0.11 and got this (I hope full) list:
- round(x, y) - x (expression evaluation not supported)
- substring(x from y for z) - y (expression evaluation not supported)
- dateadd(x unit to y) - y (expression evaluation not supported)
- datediff(unit from x to y) - x, y (expression evaluation not supported)
- bin_and, bin_not, bin_or, bin_shl, bin_shr, bin_xor - all arguments (expression evaluation not supported)
- extract(day from x) - x (Specified EXTRACT part does not exist in input datatype.)
Suggested fix: add automatic string-to-number (string-to-timestamp) type cast.
It's better to test v5. It's very unlikely this type of change going to v3 when there are already two new major versions for some time.
I retest cases with WI-V5.0.1.1469 Firebird 5.0 server. Got same results with same error messages.