Subject: | (int4) bind type picked for varchar column. |
I would like to call your attention to
http://rt.cpan.org/Public/Bug/Display.html?id=34840
There seems to be some possibility that the problem described
in that ticket is actually caused by a Class::DBI (or a
Class::DBI::Sweet) bug.
The problem appears to get "fixed" by unconditionally and
immediately returning from _bind_param() in Class::DBI,
leaving bind types 'unknown'.
Since the very similar COUNT query works and exactly two consecutive
bind params in the failing query are assigned type (int4) (as
opposed to all bind types left (unknown) for the COUNT query),
I can surmise that the (int4) bind type assignments are intended for
the LIMIT and OFFSET values, but that somehow, Class::DBI (or whoever
else it may be that is making that call) mixes up the order of the
bind params (or the total number of them), assigning bind type
(int4) to params #5 and #6, instead of the intended #9 and #10,
the LIMIT and OFFSET integers.
If this does not look like a bug (and is perhaps due to misuse of
Class::DBI), or it is difficult to fix, I would like to hear what
you guys think about the return-from-_bind_param()-right-away
workaround. Could that cause problems in some cases, or is it
only a hopefully tolerable inefficiency?
If you are interested, I will try to reduce the problem to a small
test script and test database, but that will probably take me at least
half a day. I am therefore hoping that you will say that the
workaround is fine or that you know exactly what this is about and
tell me how I can magically fix it at once =)