Skip Menu |

This queue is for tickets about the DBD-SQLite CPAN distribution.

Report information
The Basics
Id: 8021
Status: resolved
Priority: 0/
Queue: DBD-SQLite

Owner: Nobody in particular
Requestors: cpan [...]

Bug Information
Severity: (no value)
Broken in: 1.07
Fixed in: (no value)

Subject: V3 chewing up tiemstamps?
Download (untitled) / with headers
text/plain 1.6k
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.
From: Brad Choate
Download (untitled) / with headers
text/plain 390b
[TIMA - Fri Oct 15 07:47:09 2004]: Show quoted text
> Well, DBD::SQLite is apparently broken:
See also: Since MT passes the date into SQLite without any punctuation, it looks like a big number. And it truncates that number to 32 bits and stores it that way. We may start storing dates with punctuation to avoid this bug, but it definitely should be fixed...

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to