summaryrefslogtreecommitdiff
path: root/t/CP_Testing.pm
diff options
context:
space:
mode:
authorChristoph Berg2015-03-23 14:52:49 +0000
committerChristoph Berg2015-03-23 15:19:16 +0000
commitf069af5d60587c93efd7c190706f08b81d6fad1f (patch)
tree1728d8f6a9a34b26a5205edc3708e3508e90d4e0 /t/CP_Testing.pm
parent5a5cf9ffc53207517aadc3f2619ce4f6cb82c8f5 (diff)
Query all sequences per DB in parallel for action=sequence
action=sequence used to open a new session for every sequence checked, which could be very slow. Fix by creating a single SQL statement using UNION ALL to query all sequences at once.
Diffstat (limited to 't/CP_Testing.pm')
-rw-r--r--t/CP_Testing.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/t/CP_Testing.pm b/t/CP_Testing.pm
index 28ff60b3f..c473c9f75 100644
--- a/t/CP_Testing.pm
+++ b/t/CP_Testing.pm
@@ -700,7 +700,8 @@ sub drop_sequence_if_exists {
$SQL = q{SELECT count(*) FROM pg_class WHERE relkind = 'S' AND relname = } . $dbh->quote($name);
my $count = $dbh->selectall_arrayref($SQL)->[0][0];
if ($count) {
- $dbh->do("DROP SEQUENCE $name");
+ $name =~ s/"/""/g;
+ $dbh->do("DROP SEQUENCE \"$name\"");
$dbh->commit();
}
return;