Subject: | Spurious "not an error" and "bind or column index out of range" errirs |
DBD::SQLite 1.13 intermittently spits out strange errors like these:
DBD::SQLite::st fetchrow_hashref warning: not an error(0) at dbdimp.c
line 504
DBD::SQLite::st execute failed: bind or column index out of range(25) at
dbdimp.c line 376
The first one is just baffling. (Not an error?) The second one looks
legit, but I tracked it down and found that the number of bind columns
was correct. I tried chasing it through the C code and found a
situation where the number "?" of placeholders found by DBD::SQLite was
one less than the actual number of "?" in the SQL. (p->nVar was 3 when
there were clearly 4 "?" placeholders in p->zSql.) This was not a
complex query either, just a standard INSERT into a table with four
INTEGER columns.
The intermittent nature is why there's no script to reproduce this issue
attached to this bug report. I wrote such a script, but then
DBD::SQLite decided to start behaving itself and refused to throw the
error. In much more complex code (the Rose::DB::Object test suite) it'd
still happen, but not in an isolated version of the call. I even added
some of the surrounding calls in an attempt to get it to fail, but
eventually gave up.
But the *really* strange thing is that DBD::SQLite 1.13 seems to get
progressively worse as time goes on. This morning, I could run the
whole Rose::DB::Object test suite against SQLite with DBD::SQLite 1.13
and I only got one "not an error" error. As the day progressed, with no
code changes anywhere, it started to throw some "bind or column index
out of range(25)" errors. (Yes, I deleted the SQLite database file
between runs.) I downgraded to DBD::SQLite 1.12 and the test suite
immediately ran without any errors at all.
Sorry this is such a bad bug report. I'm still trying to isolate this,
but I just thought someone should know that 1.13 is, like, totally wonky.