Subject Re: [Firebird-Java] SQL Query -> DataTruncation Exception
Author Roman Rokytskyy
> I would like to make a case for _not_ considering this a bug. I feel
> that it is only logical that binding an oversized value to a
> fixed-size field should throw an exception, regardless whether or
> not the bind parameter is being used as an update value, a value
> comparison, or a filter parameter. There is no use (that I can think
> of) for binding an oversized parameter in a search filter;

In general I agree with your reasoning. However driver should not be
responsible for such thing - all restrictions should apply in Firebird, and
driver should simply act as an adapter for the database API.

> thus I feel it is more reasonable to consider this to be a programmer
> error than a bug in the driver.

Yes, that is probably an issue of a lazy programmer that does not check the
size. However it works if you include the search pattern direct in SQL
(gives you empty result set), therefore it should be also possible to use
the same pattern with prepared statements.

I think we have to add this to FAQ.

> Finally, this behaviour (not accepting an oversized bind value for a
> filter parameter) is consistent with the behaviour of both the
> kinterbasdb driver for Python, and the DBD::InterBase driver for Perl.

Finally somebody has to take care about it in the Firebird. Hopefully this
will happen automagically during merge with Vulcan.