diff --git a/src/parallel b/src/parallel index 304f8e38..d2b6550d 100755 --- a/src/parallel +++ b/src/parallel @@ -11729,9 +11729,14 @@ sub new($) { my $dsn = "DBI:$driver:dbname=$database$host$port"; my $userid = $options{'user'}; 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, { RaiseError => 1, AutoInactiveDestroy => 1 }) or die $DBI::errstr; + $dbh->{'PrintWarn'} = $Global::debug || 0; $dbh->{'PrintError'} = $Global::debug || 0; $dbh->{'RaiseError'} = 1; diff --git a/testsuite/tests-to-run/parallel-local-3s.sh b/testsuite/tests-to-run/parallel-local-3s.sh index 047a948e..d8eb213b 100644 --- a/testsuite/tests-to-run/parallel-local-3s.sh +++ b/testsuite/tests-to-run/parallel-local-3s.sh @@ -170,6 +170,14 @@ par_sqlworker_hostname() { perl -pe "s/$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() { echo 'bug #51299: --retry-failed with command with newline' echo 'The format must remain the same' diff --git a/testsuite/wanted-results/parallel-local-3s b/testsuite/wanted-results/parallel-local-3s index 97cd6b36..9dcca28f 100644 --- a/testsuite/wanted-results/parallel-local-3s +++ b/testsuite/wanted-results/parallel-local-3s @@ -171,6 +171,9 @@ par_slow_args_generation ### Test slow arguments generation - https://savannah.g par_slow_args_generation 1 par_slow_args_generation 2 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 1 par_sqlworker_hostname 2