Skip Menu |
 

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

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

People
Owner: Nobody in particular
Requestors: ribasushi [...] leporine.io
Cc:
AdminCc:

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



Subject: DBD::SQLite does not implement $sth->{NULLABLE}
Download (untitled) / with headers
text/plain 158b
It seems that DBD::SQLite flat out does not implement the NULLABLE $sth attribute as described in DBI.pm. Attached is a failing test patch for t/60metadata.t
Subject: nullable_fail.diff
Download nullable_fail.diff
text/x-diff 1.1k
diff -ru DBD-SQLite-1.14/t/60metadata.t DBD-SQLite-1.14patched/t/60metadata.t --- DBD-SQLite-1.14/t/60metadata.t 2007-08-23 02:01:06.000000000 +0200 +++ DBD-SQLite-1.14patched/t/60metadata.t 2008-11-01 16:05:57.806987272 +0100 @@ -1,6 +1,7 @@ use Test; -BEGIN { plan tests => 27 } +BEGIN { plan tests => 33 } use DBI; +use Data::Dumper; my $dbh = DBI->connect("dbi:SQLite:dbname=foo", "", "", { }); ok($dbh); $dbh->{PrintError} = 0; @@ -50,3 +51,23 @@ ok $dbh->do("create table meta5 ( f1 integer PRIMARY KEY )"); @pk = $dbh->primary_key(undef, undef, 'meta5'); ok($pk[0] eq 'f1'); + +ok $dbh->do("create table meta6 (id INTEGER PRIMARY KEY NOT NULL, col1 varchar(2) NOT NULL, col2 varchar(2), col3 char(2) NOT NULL)" ); +my $sth = $dbh->prepare ('select * from meta6'); +ok $sth->execute; + +my $expected = { + NUM_OF_FIELDS => 4, + NAME_lc => [qw/id col1 col2 col3/], + TYPE => [qw/INTEGER varchar(2) varchar(2) char(2)/], + NULLABLE => [qw/0 0 1 0/], +}; + +for my $m (keys %$expected) { + local $Data::Dumper::Sortkeys = 1; + print "# Comparing $m\n"; + my $got = Dumper ($sth->{$m}); + my $exp = Dumper ($expected->{$m}); + ok ($got eq $exp); + #or print "Got:\n$got\n Expected:\n$exp"; +}
Implemented, and a regression test has been added to the test suite. Flagging as resolved.


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.