Subject: | Report a bug in DBD-CSV |
Date: | Wed, 04 Nov 2009 08:52:29 +0800 |
To: | bug-DBD-CSV [...] rt.cpan.org |
From: | vgdoqd [...] gmail.com |
Distribution name and version: DBD-CSV-0.25
Perl version: v5.10.1
Operating System vendor and version: Linux 2.6.29.2 #1 SMP Sat May 2
07:52:32 CST 2009 i686 GNU/Linux
---== code reproduces the bug ==---
#!/usr/local/bin/perl -w
use strict;
use 5.010;
use DBI qw(:sql_types);
my $dbh = DBI->connect("dbi:CSV:csv_sep_char=\t");
my $sth = $dbh->prepare(q{SELECT * FROM foo});
$dbh->{csv_tables}{foo}{types} = [SQL_INTEGER, SQL_LONGVARCHAR,
SQL_NUMERIC];
say join "\t", @{$dbh->{csv_tables}{foo}{types}};
$sth->execute();
say join "\t", @{$dbh->{csv_tables}{foo}{types}};
$dbh->disconnect();
---== output (believe this is not what intended to be) ==---
4 -1 2
0 0 0
---== output (1, 0, 2 now correspond|| to |Text::CSV_XS::IV**| etc.) ==---
4 -1 2
1 0 2
---== patch ==---
--- CSV.pm.orig 2009-10-11 19:17:33.000000000 +0800
+++ CSV.pm 2009-10-11 19:17:33.000000000 +0800
@@ -207 +207 @@
- ? $DBD::CSV::CSV_TYPES[$_ + 6] || Text::CSV_XS::PV ()
+ ? $DBD::CSV::dr::CSV_TYPES[$_ + 6] ||
Text::CSV_XS::PV ()