Skip Menu |

This queue is for tickets about the DBI CPAN distribution.

Report information
The Basics
Id: 61513
Status: resolved
Priority: 0/
Queue: DBI

People
Owner: Nobody in particular
Requestors: reinpost [...] win.tue.nl
Cc:
AdminCc:

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



When slightly modifying the examples of reading /etc/passwd in the POD file, things break in ways I can't explain. The attached script works fine. When I initialize csv_tables within the connect statement (by uncommenting the four commnented lines), it breaks: execute complains that the file 'dinges' cannot be found. This happens when I leave the lines that explicitly set csv_tables in, and also when I remove them. It even happens when I initialize csv_tables in the connect statement to {}. Apparently, the initialization keeps the explicit assignment later from taking effect. I'm using Cygwin's Perl (see second attachment) but I've installed and upgraded DBD::CSV with the CPAN shell: DBI is up to date (1.614). Text::CSV_XS is up to date (0.73). SQL::Statement is up to date (1.31). DBD::File is up to date (0.40). DBD::CSV is up to date (0.31).
Subject: csv_tables_bug.pl
#!/usr/bin/env perl use warnings; use strict; use DBI; my $dbh = DBI->connect ("dbi:CSV:", undef, undef, { csv_sep_char => ":", csv_quote_char => undef, csv_escape_char => undef, csv_eol => "\n", # csv_tables => { dinges => { # col_names => [qw( login password uid gid realname directory shell )], # file => '/etc/passwd' # }} }); # does *not* work with the csv_tables entry uncommented $dbh->{csv_tables}{dinges} = { file => "/etc/passwd", col_names => [qw( login password uid gid realname directory shell )] }; # now it *does* work my $sth = $dbh->prepare ("SELECT * FROM dinges") or die "prepare failed: ", DBI::errstr, "\n"; $sth->execute or die "execute failed: ", DBI::errstr, "\n"; while (my $r = $sth->fetchrow_arrayref) { print $r->[0], "\n"; }
Subject: perl-V
Download perl-V
application/octet-stream 2.8k

Message body not shown because it is not plain text.

From: reinpost [...] win.tue.nl
The same thing happens on Linux.
Subject: perl-V-linux
Download perl-V-linux
application/octet-stream 2k

Message body not shown because it is not plain text.

Patched, so presumably resolved in 1.618.
From: reinpost [...] win.tue.nl
On Wed Mar 14 08:06:07 2012, TIMB wrote: Show quoted text
> Patched, so presumably resolved in 1.618.
I just tested again on my Cygwin installation, which supplies perl v5.10.1 and DBI 1.616: indeed, the problem has disappeared.