Skip Menu |
 

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

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

People
Owner: Nobody in particular
Requestors: a.r.ferreira [...] gmail.com
Cc:
AdminCc:

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



Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.417 (Entity 5.417)
Subject: Accepting bad SQL "select 'eek"
X-RT-Original-Encoding: iso-8859-1
Content-Length: 1175
Download (untitled) / with headers
text/plain 1.1k
While developing, I gave DBD::SQLite a bad SQL statement like "select 'eek" (quoted string not terminated). It worked and gave a weird answer. Is that something I should be expecting? Some oddity of SQLite? The following test script was run #!/usr/bin/perl use DBI; use DBD::SQLite; use Test::More tests => 5; diag("\$DBI::VERSION: $DBI::VERSION, \$DBD::SQLite::VERSION: $DBD::SQLite::VERSION\n"); my $dbh = DBI->connect('dbi:SQLite:dbname=t.db'); ok($dbh, 'defined $dbh'); # this is bad SQL my $sql = "select 'eek"; my $sth = $dbh->prepare($sql); ok($sth, "defined \$sth (SQL: $sql) ?!"); ok($sth->execute, "execute ok ?!"); my @row = $sth->fetchrow_array; is(scalar @row, 1, 'one column fetched'); is($row[0], 'eekk', 'returning "eekk", arghh!'); and gave the output $ perl bug.pl 1..5 # $DBI::VERSION: 1.48, $DBD::SQLite::VERSION: 1.09 ok 1 - defined $dbh ok 2 - defined $sth (SQL: select 'eek) ?! ok 3 - execute ok ?! ok 4 - one column fetched ok 5 - returning "eekk", arghh! $ perl -v This is perl, v5.8.7 built for cygwin-thread-multi-64int $ uname -a CYGWIN_NT-5.0 INF-020 1.5.18(0.132/4/2) 2005-07-02 20:30 i686 unknown unknown Cygwin
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.417 (Entity 5.417)
Subject: Accepting bad SQL "select 'eek"
X-RT-Original-Encoding: iso-8859-1
Content-Length: 1175
Download (untitled) / with headers
text/plain 1.1k
While developing, I gave DBD::SQLite a bad SQL statement like "select 'eek" (quoted string not terminated). It worked and gave a weird answer. Is that something I should be expecting? Some oddity of SQLite? The following test script was run #!/usr/bin/perl use DBI; use DBD::SQLite; use Test::More tests => 5; diag("\$DBI::VERSION: $DBI::VERSION, \$DBD::SQLite::VERSION: $DBD::SQLite::VERSION\n"); my $dbh = DBI->connect('dbi:SQLite:dbname=t.db'); ok($dbh, 'defined $dbh'); # this is bad SQL my $sql = "select 'eek"; my $sth = $dbh->prepare($sql); ok($sth, "defined \$sth (SQL: $sql) ?!"); ok($sth->execute, "execute ok ?!"); my @row = $sth->fetchrow_array; is(scalar @row, 1, 'one column fetched'); is($row[0], 'eekk', 'returning "eekk", arghh!'); and gave the output $ perl bug.pl 1..5 # $DBI::VERSION: 1.48, $DBD::SQLite::VERSION: 1.09 ok 1 - defined $dbh ok 2 - defined $sth (SQL: select 'eek) ?! ok 3 - execute ok ?! ok 4 - one column fetched ok 5 - returning "eekk", arghh! $ perl -v This is perl, v5.8.7 built for cygwin-thread-multi-64int $ uname -a CYGWIN_NT-5.0 INF-020 1.5.18(0.132/4/2) 2005-07-02 20:30 i686 unknown unknown Cygwin
Return-Path: <a.r.ferreira [...] gmail.com>
X-Original-To: bug-DBD-SQLite [...] rt.cpan.org
Delivered-To: cpan-bug+dbd-sqlite [...] diesel.bestpractical.com
Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 60BDE4D809B for <bug-DBD-SQLite [...] rt.cpan.org>; Fri, 21 Oct 2005 11:03:10 -0400 (EDT)
Received: (qmail 8760 invoked by alias); 21 Oct 2005 15:02:53 -0000
X-Spam-Check-BY: la.mx.develooper.com
Received-SPF: pass (x1.develooper.com: domain of a.r.ferreira [...] gmail.com designates 72.14.204.197 as permitted sender)
Received: from qproxy.gmail.com (HELO qproxy.gmail.com) (72.14.204.197) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Fri, 21 Oct 2005 08:02:39 -0700
Received: by qproxy.gmail.com with SMTP id q18so324187qba for <bug-DBD-SQLite [...] rt.cpan.org>; Fri, 21 Oct 2005 08:02:35 -0700 (PDT)
Domainkey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=opwk8LXjiuxiPRvPcaKQYWdnEl7NtHByzLOfZSJPHlX6bIfsQBth+O9LhB1ci7q1l4Lbp9VzEF1XfdMcd3uvfmQD2mPmTSpagTIShHwkCWQVut7XYXF4bIT4H/WeRFrdXnlqB9Ks5sILmv3HocgPJkcrp+P4qyN6Dn9tV8yaT4Y=
Received: by 10.65.156.11 with SMTP id i11mr2027374qbo; Fri, 21 Oct 2005 08:02:35 -0700 (PDT)
Received: by 10.65.95.7 with HTTP; Fri, 21 Oct 2005 08:02:35 -0700 (PDT)
Message-ID: <73ddeb6c0510210802hdec682q6beb9cd40e3c5b9f [...] mail.gmail.com>
Date: Fri, 21 Oct 2005 13:02:35 -0200
From: Adriano Ferreira <a.r.ferreira [...] gmail.com>
To: dbi-users [...] perl.org, Matt Sergeant <matt [...] sergeant.org>, bug-DBD-SQLite [...] rt.cpan.org
Subject: Re: Is it a bug in DBD::SQLite? [cpan #15166]
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
RT-Send-Cc:
X-RT-Original-Encoding: iso-8859-1
Content-Length: 1765
Download (untitled) / with headers
text/plain 1.7k
Actually this seems an issue with SQLite 3.2. DBD::SQLite 1.09 uses 3.2.2. And it is reproducible with the Java wrapper over 3.2.1. A statement like SELECT 'a which should be a syntax error, doubles the last character, returning (in this example) a row with one column 'aa'. On 10/20/05, Adriano Ferreira <a.r.ferreira@gmail.com> wrote: Show quoted text
> While developing, I gave DBD::SQLite a bad SQL statement like "select > 'eek" (quoted string not terminated). It worked and gave a weird > answer. Is that something I should be expecting? Some oddity of > SQLite? > > The following test script was run > #!/usr/bin/perl > > use DBI; > use DBD::SQLite; > use Test::More tests => 5; > > diag("\$DBI::VERSION: $DBI::VERSION, \$DBD::SQLite::VERSION: > $DBD::SQLite::VERSION\n"); > > my $dbh = DBI->connect('dbi:SQLite:dbname=t.db'); > ok($dbh, 'defined $dbh'); > > # this is bad SQL > my $sql = "select 'eek"; > my $sth = $dbh->prepare($sql); > ok($sth, "defined \$sth (SQL: $sql) ?!"); > ok($sth->execute, "execute ok ?!"); > my @row = $sth->fetchrow_array; > is(scalar @row, 1, 'one column fetched'); > is($row[0], 'eekk', 'returning "eekk", arghh!'); > > and gave the output > > $ perl bug.pl > 1..5 > # $DBI::VERSION: 1.48, $DBD::SQLite::VERSION: 1.09 > ok 1 - defined $dbh > ok 2 - defined $sth (SQL: select 'eek) ?! > ok 3 - execute ok ?! > ok 4 - one column fetched > ok 5 - returning "eekk", arghh! > > $ perl -v > This is perl, v5.8.7 built for cygwin-thread-multi-64int > > $ uname -a > CYGWIN_NT-5.0 INF-020 1.5.18(0.132/4/2) 2005-07-02 20:30 i686 unknown > unknown Cygwin >
MIME-Version: 1.0
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
Message-Id: <rt-3.6.HEAD-2100-1157686602-1814.15164-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 52
Looks like it's an SQLite issue, not a driver issue.


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.