Skip Menu |
 

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

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

People
Owner: Nobody in particular
Requestors: efrazier [...] doubleprime.com
Cc:
AdminCc:

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



Subject: Date Functions less forgiving in DBD vs sqlite3 cmd
Date: Thu, 3 Sep 2015 12:56:19 -0600
To: <bug-DBD-SQLite [...] rt.cpan.org>
From: "Eric Frazier" <efrazier [...] doubleprime.com>
Download (untitled) / with headers
text/plain 1018b
SQLite version 3.3.6 Enter ".help" for instructions Show quoted text
sqlite> SELECT date('now','-1day');
2015-09-02 Show quoted text
sqlite> SELECT date('now','-1 day');
2015-09-02 vs WORKS: #!/usr/bin/perl use DBI; my $dbh = DBI->connect('dbi:SQLite:dbname=foo.sqlite','','',{AutoCommit=>1,RaiseError= Show quoted text
>1,PrintError=>0});
print $dbh->selectrow_array("SELECT date('now','-1 day')"),"\n"; [efrazier@emailsc2 ~]$ perl sqltest.pl 2015-09-02 Doesn't work: #!/usr/bin/perl use DBI; my $dbh = DBI->connect('dbi:SQLite:dbname=foo.sqlite','','',{AutoCommit=>1,RaiseError= Show quoted text
>1,PrintError=>0});
print $dbh->selectrow_array("SELECT date('now','-1day')"),"\n"; [efrazier@emailsc2 ~]$ perl sqltest.pl And most importantly it seems to fail silently. Other info: [efrazier@emailsc2 ~]$ perl -v This is perl, v5.8.8 built for x86_64-linux-thread-multi uname -a Linux emailsc2 2.6.18-348.el5 #1 SMP Wed Nov 28 21:22:00 EST 2012 x86_64 x86_64 x86_64 GNU/Linux DBD::SQLite version --> package DBD::SQLite; our $VERSION = '1.48'; Thanks, Eric
Download (untitled) / with headers
text/plain 1.6k
On Fri Sep 04 03:56:32 2015, efrazier@doubleprime.com wrote: Show quoted text
> > SQLite version 3.3.6 > Enter ".help" for instructions
> sqlite> SELECT date('now','-1day');
> 2015-09-02 >
> sqlite> SELECT date('now','-1 day');
> 2015-09-02 > > vs > > WORKS: > > #!/usr/bin/perl > > use DBI; > my $dbh = > DBI->connect('dbi:SQLite:dbname=foo.sqlite','','',{AutoCommit=>1,RaiseError=
> >1,PrintError=>0});
> print $dbh->selectrow_array("SELECT date('now','-1 day')"),"\n"; > > [efrazier@emailsc2 ~]$ perl sqltest.pl > 2015-09-02 > > > > Doesn't work: > > > #!/usr/bin/perl > > use DBI; > my $dbh = > DBI->connect('dbi:SQLite:dbname=foo.sqlite','','',{AutoCommit=>1,RaiseError=
> >1,PrintError=>0});
> print $dbh->selectrow_array("SELECT date('now','-1day')"),"\n"; > > [efrazier@emailsc2 ~]$ perl sqltest.pl > > And most importantly it seems to fail silently. > > > Other info: > > [efrazier@emailsc2 ~]$ perl -v > > This is perl, v5.8.8 built for x86_64-linux-thread-multi > > uname -a > Linux emailsc2 2.6.18-348.el5 #1 SMP Wed Nov 28 21:22:00 EST 2012 x86_64 > x86_64 x86_64 GNU/Linux > > DBD::SQLite version --> package DBD::SQLite; our $VERSION = '1.48'; > > Thanks, > > Eric > > > >
This is an upstream change (or maybe a regression) happened between 3.7.2 (released on 2010-08-24) and 3.7.3 (released on 2010-10-08), most probably because of their rework of the text to numeric conversion routines (see also http://www.sqlite.org/cgi/src/info/07ee080ec4527fd2 and http://www.sqlite.org/cgi/src/finfo?name=src/date.c). If you do think this is an old but important issue to be fixed, please report it to the upstream mailing list (http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users).
Closed as wontfix because there seems no follow-up for a while.


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

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.