|Subject:||V3 chewing up tiemstamps?|
I reported a bug with Movable Typ were using DBD::SQLite 1+ caused timestamps to get garbled and cause the system to break. After some investigation I got a report back from one of its engineers that there is a bug in the SQLite3 implementation. See below. --- Well, DBD::SQLite is apparently broken: USING SQLITE3: Show quoted text
sqlite> select * from mt_entry;1|1|2|1|1|0|__default__||La la la||Laaaaaaa|..|||||20041014230348|20041014230405|la_la_la|| And using DBD::SQLite 1.07 against the same database: $ perl -e 'use DBI; $dbh = DBI->connect("dbi:SQLite:dbname=/tmp/monkey-balls", "", ""); $sth = $dbh->prepare("select * from mt_entry"); $sth->execute(); @rslt = $sth->fetchrow_array(); print join " ", @rslt, "\n"' 1 1 2 1 1 0 __default__ La la la Laaaaaaa .. 696827212 696827269 la_la_la As you can see, the timestamp 20041014230348 is getting replaced by the value 696827212 within DBI, before it ever gets to MT. Using the DBD::SQLite2 module against sqlite v2.8.15, DBI actually returns the correct answer: $ perl -Iblib/lib -Iblib/arch -e 'use DBI; $dbh = DBI->connect("dbi:SQLite2:dbname=/tmp/monkey-balls2", "", ""); $sth = $dbh->prepare("select * from mt_entry"); $sth->execute(); @rslt = $sth->fetchrow_array(); print join " ", @rslt, "\n"' 20041014230348 And it's not because the data is any different in the database (this with sqlite 2.8.15): Show quoted text
sqlite> select entry_created_on from mt_entry;20041014230348 SQLite can store and return the data just fine, but DBD::SQLite 1.07 is interpreting the value as a number and it's getting sliced to 32 bits. I dub that incorrect behavior on the part of DBD::SQLite 1.07.