Closed ufobat closed 3 years ago
Is this related? https://rt.cpan.org/Public/Bug/Display.html?id=133294
I don't think it is. I fixed the issue for this ticket, but I have to add some tests for it. If you cannot wait, this is the fix:
diff --git a/lib/DBD/CSV.pm b/lib/DBD/CSV.pm
index 8f46ffd..2a3a1a3 100755
--- a/lib/DBD/CSV.pm
+++ b/lib/DBD/CSV.pm
@@ -15,8 +15,8 @@ require DynaLoader;
require DBD::File;
require IO::File;
-our @f_SHORT = qw( file dir dir_search ext lock lockfile schema encoding );
-our @c_SHORT = qw( class eof
+our @f_SHORT = qw( class file dir dir_search ext lock lockfile schema encoding );
+our @c_SHORT = qw( eof
eol sep_char quote_char escape_char binary decode_utf8 auto_diag
diag_verbose blank_is_undef empty_is_undef allow_whitespace
allow_loose_quotes allow_loose_escapes allow_unquoted_escape
Now pushed with test cases.
Note that using a different class (not the case in your example, which pointed to a real bug) requires the invoking script to use
/require
that class before connecting, so your example for Text::CSV
would be
use strict;
use warnings;
use DBI;
use Text::CSV; # <--- this line is required when using another class
my $tbl = shift || "foo";
# See "Creating database handle" below
my $dbh = DBI->connect ("dbi:CSV:", undef, undef, {
f_ext => ".csv/r",
RaiseError => 1,
PrintError => 1,
csv_class => "Text::CSV",
}) or die "Cannot connect: $DBI::errstr";
$dbh->do ("CREATE TABLE $tbl (id INTEGER, name CHAR (10))");
DBD::CSV-0.58
released
Hi everyone, I've taken the example from the SYNOPSIS and added a line with the content of
csv_class => 'Text::CSV_XS'
to it:Though I expected to change nothing, because
Text::CSV_XS
should be the default value, my programm now fails. With the help of Carp::Always I got this error stacktrace:Can someone help, please?