Remove all tables, so other test tables don't interfere.
authorGreg Sabino Mullane <[email protected]>
Thu, 23 Apr 2009 17:52:37 +0000 (13:52 -0400)
committerGreg Sabino Mullane <[email protected]>
Thu, 23 Apr 2009 17:52:37 +0000 (13:52 -0400)
t/02_relation_size.t

index f1e28ce804ffe280b77631d360fc08febcbb1d29..acc3c101e7d45e3908be2b2671b119e72ce365cd 100644 (file)
@@ -52,9 +52,14 @@ like ($cp->run(q{-w 1 --perflimit 2}),
 $t = qq{$S detects no matching tables due to unknown user};
 like ($cp->run(q{-w 1 --includeuser foo}), qr{$label OK:.*No matching entries found due to user exclusion/inclusion options}, $t);
 
+## We need to remove all tables to make this work correctly
 local $dbh->{Warn} = 0;
-$dbh->do("DROP TABLE IF EXISTS $testtbl");
+my @info = $dbh->tables('','public','','TABLE');
+for my $tab (@info) {
+       $dbh->do("DROP TABLE $tab CASCADE");
+}
 $dbh->do(qq{CREATE TABLE $testtbl (a integer)});
+
 $dbh->commit;
 
 $t = qq{$S detects matching tables using 'testuser'};