Skip to content

Commit acc57de

Browse files
committed
Adjust test for version 12 which removed pg_constraint.consrc
1 parent 94b3854 commit acc57de

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

t/02_same_schema.t

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ my $cp3 = CP_Testing->new({ default_action => 'same_schema', dbnum => 3});
1818

1919
## Setup all database handles, and create a testing user
2020
$dbh1 = $cp1->test_database_handle();
21+
my $ver = $dbh1->{pg_server_version};
2122
$dbh1->{AutoCommit} = 1;
2223
eval { $dbh1->do(q{CREATE USER alternate_owner}, { RaiseError => 0, PrintError => 0 }); };
2324
$dbh2 = $cp2->test_database_handle();
@@ -566,19 +567,21 @@ like ($cp1->run($connect2),
566567

567568
$t = qq{$S reports constraint with different definitions};
568569
$dbh2->do(q{ALTER TABLE yamato ADD CONSTRAINT iscandar CHECK(nova > 256)});
569-
like ($cp1->run($connect2),
570-
qr{^$label CRITICAL.*Items not matched: 1 .*
571-
\s*Constraint "public.yamato.iscandar":
570+
571+
## Version 12 removed the pg_constraint.consrc column
572+
my $extra = $ver >= 120000 ? '' : q{
572573
\s*"consrc" is different:
573574
\s*Database 1: \(nova > 0\)
574-
\s*Database 2: \(nova > 256\)
575+
\s*Database 2: \(nova > 256\)};
576+
577+
like ($cp1->run($connect2),
578+
qr{^$label CRITICAL.*Items not matched: 1 .*
579+
\s*Constraint "public.yamato.iscandar":$extra
575580
\s*"constraintdef" is different:
576581
\s*Database 1: CHECK \(\(nova > 0\)\)
577582
\s*Database 2: CHECK \(\(nova > 256\)\)\s*$}s,
578583
$t);
579584

580-
581-
582585
$t = qq{$S does not report constraint differences if the 'noconstraint' filter is given};
583586
like ($cp1->run("$connect3 --filter=noconstraint,notables"), qr{^$label OK}, $t);
584587

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy