Fixed: bug #56096: dbi-csv no such column.

This commit is contained in:
Ole Tange 2019-04-28 23:02:10 +02:00
parent 81741d3dbc
commit 9fd39b122d
3 changed files with 16 additions and 0 deletions

View file

@ -11729,9 +11729,14 @@ sub new($) {
my $dsn = "DBI:$driver:dbname=$database$host$port"; my $dsn = "DBI:$driver:dbname=$database$host$port";
my $userid = $options{'user'}; my $userid = $options{'user'};
my $password = $options{'password'};; my $password = $options{'password'};;
if(not grep /$driver/, DBI->available_drivers) {
::error("$driver not supported. Are you missing a perl DBD::$driver module?");
::wait_and_exit(255);
}
my $dbh = DBI->connect($dsn, $userid, $password, my $dbh = DBI->connect($dsn, $userid, $password,
{ RaiseError => 1, AutoInactiveDestroy => 1 }) { RaiseError => 1, AutoInactiveDestroy => 1 })
or die $DBI::errstr; or die $DBI::errstr;
$dbh->{'PrintWarn'} = $Global::debug || 0; $dbh->{'PrintWarn'} = $Global::debug || 0;
$dbh->{'PrintError'} = $Global::debug || 0; $dbh->{'PrintError'} = $Global::debug || 0;
$dbh->{'RaiseError'} = 1; $dbh->{'RaiseError'} = 1;

View file

@ -170,6 +170,14 @@ par_sqlworker_hostname() {
perl -pe "s/$hostname/<hostname>/g" perl -pe "s/$hostname/<hostname>/g"
} }
par_sqlandworker_uninstalled_dbd() {
echo 'bug #56096: dbi-csv no such column'
sudo mv /usr/share/perl5/DBD/CSV.pm /usr/share/perl5/DBD/CSV.pm.gone
parallel --sqlandworker csv:////%2Ftmp%2Flog.csv echo ::: must fail
sudo cp /usr/share/perl5/DBD/CSV.pm.gone /usr/share/perl5/DBD/CSV.pm
parallel --sqlandworker csv:////%2Ftmp%2Flog.csv echo ::: works
}
par_commandline_with_newline() { par_commandline_with_newline() {
echo 'bug #51299: --retry-failed with command with newline' echo 'bug #51299: --retry-failed with command with newline'
echo 'The format must remain the same' echo 'The format must remain the same'

View file

@ -171,6 +171,9 @@ par_slow_args_generation ### Test slow arguments generation - https://savannah.g
par_slow_args_generation 1 par_slow_args_generation 1
par_slow_args_generation 2 par_slow_args_generation 2
par_slow_args_generation 3 par_slow_args_generation 3
par_sqlandworker_uninstalled_dbd bug #56096: dbi-csv no such column
par_sqlandworker_uninstalled_dbd parallel: Error: CSV not supported. Are you missing a perl DBD::CSV module?
par_sqlandworker_uninstalled_dbd works
par_sqlworker_hostname bug #50901: --sqlworker should use hostname in the joblog instead of : par_sqlworker_hostname bug #50901: --sqlworker should use hostname in the joblog instead of :
par_sqlworker_hostname 1 par_sqlworker_hostname 1
par_sqlworker_hostname 2 par_sqlworker_hostname 2