X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Makefile.PL;h=c1b65967505cbf250a6b30b7a5d6f0f099266455;hb=c4e67d31ed6f3fb01c07451cdf69c0782bc610a2;hp=a5bd70a3ed2762d9384c9231cc332a6374bb15f7;hpb=f4086911882bd523b07597f2f001a2786aee2dd0;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/Makefile.PL b/Makefile.PL index a5bd70a..c1b6596 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -62,6 +62,56 @@ auto_provides; auto_install; +# Have all prerequisites, check DBD::SQLite sanity +{ + my $pid = fork(); + if (not defined $pid) { + die "Unable to fork(): $!"; + } + elsif (! $pid) { + require DBI; + for (1 .. 10) { + my $dbh; + $dbh = DBI->connect ('dbi:SQLite::memory:', undef, undef, { + AutoCommit => 1, + RaiseError => 0, + PrintError => 0, + }) + or die "Unable to connect to database: $@"; + $dbh->do ('CREATE TABLE name_with_no_columns'); # a subtle syntax error + $dbh->do ('COMMIT'); # followed by commit + $dbh->disconnect; + } + + exit 0; + } + else { + wait(); + my $sig = $? & 127; + if ($sig == 11) { + warn (<