Is it a bug in DBD::SQLite?
am 20.10.2005 18:26:54 von a.r.ferreiraWhile 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
=09#!/usr/bin/perl
=09use DBI;
=09use DBD::SQLite;
=09use Test::More tests =3D> 5;
=09diag("\$DBI::VERSION: $DBI::VERSION, \$DBD::SQLite::VERSION:
$DBD::SQLite::VERSION\n");
=09my $dbh =3D DBI->connect('dbi:SQLite:dbname=3Dt.db');
=09ok($dbh, 'defined $dbh');
=09# this is bad SQL
=09my $sql =3D "select 'eek";
=09my $sth =3D $dbh->prepare($sql);
=09ok($sth, "defined \$sth (SQL: $sql) ?!");
=09ok($sth->execute, "execute ok ?!");
=09my @row =3D $sth->fetchrow_array;
=09is(scalar @row, 1, 'one column fetched');
=09is($row[0], 'eekk', 'returning "eekk", arghh!');
and gave the output
=09$ perl bug.pl
=091..5
=09# $DBI::VERSION: 1.48, $DBD::SQLite::VERSION: 1.09
=09ok 1 - defined $dbh
=09ok 2 - defined $sth (SQL: select 'eek) ?!
=09ok 3 - execute ok ?!
=09ok 4 - one column fetched
=09ok 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