On 12-05-2023 15:35, Kevin Morizur wrote:
> I'm currenlty having error when using latest FB 3.0 binary.
>
> From my application
>
> * request is *update or insert into table(LABEL) values(coalesce(?,''))*
> * array of params sent : *['my label']*
>
>
> LABEL is Column of type VARCHAR 100
>
> With version *WI-V6.3.10.33601 Firebird 3.0 *I get following error :
This is Firebird 3.0.10.33601, it seems your application uses an old API
for obtaining Firebird version numbers.
> Incompatible column/host variable data type.
> Dynamic SQL Error.
> SQL error code = -303.
> arithmetic exception, numeric overflow, or string truncation.
> string right truncation.
> expected length 0, actual 5.
>
> With oldest version WI-V6.3.2.32703 Firebird 3.0 *there is no error*
That is 3.0.2.32703.
> NB: I get similar error in IBexpert using following request
> "update or insert into table(LABEL) values(coalesce(:param,''))"'
>
> Do you know if this error is a bug or it is expected behavior ?
It looks like a bug with the type inference of the parameter. It seems
that it infers it from the empty string in the second parameter of
COALESCE, instead of from the type of the column the value will be
assigned to.
I'm not sure if this is a know bug or not. I suggest reporting it on
https://github.com/FirebirdSQL/firebird/issues
Mark
--
Mark Rotteveel