Replace $dbh->tables() with selectall_arrayref()
authorChristoph Berg <[email protected]>
Mon, 6 Jun 2016 17:03:36 +0000 (19:03 +0200)
committerChristoph Berg <[email protected]>
Mon, 6 Jun 2016 20:57:14 +0000 (22:57 +0200)
$dbh->tables() seems to be throwing errors in travis. Replace by
a standard catalog query.

t/02_commitratio.t ......... DBD::Pg::db tables failed: no statement executing at t/CP_Testing.pm line 825.
Looks like your test exited with 255 before it could output anything.

t/CP_Testing.pm

index d9de296f8029ece1b21dd6eb4148fc97773ae7a5..0ed72874ce55d42680b08290a0ebaa294362a43e 100644 (file)
@@ -821,9 +821,9 @@ sub drop_all_tables {
     my $self = shift;
     my $dbh = $self->{dbh} || die;
     $dbh->{Warn} = 0;
-    my @info = $dbh->tables('','public','','TABLE');
-    for my $tab (@info) {
-        $dbh->do("DROP TABLE $tab CASCADE");
+    my $tables = $dbh->selectall_arrayref("SELECT tablename FROM pg_tables WHERE schemaname = 'public'");
+    for my $tab (@$tables) {
+        $dbh->do("DROP TABLE $tab->[0] CASCADE");
     }
     $dbh->{Warn} = 1;
     $dbh->commit();