|
|
3f1506 |
From 2b60151aea6f03ac7e846aae0d21e7f335cad99c Mon Sep 17 00:00:00 2001
|
|
|
3f1506 |
From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari@ilmari.org>
|
|
|
3f1506 |
Date: Wed, 9 Jan 2019 21:24:09 +0000
|
|
|
3f1506 |
Subject: [PATCH] Fix client_min_messages=FATAL test on upcoming PostgreSQL
|
|
|
3f1506 |
releases
|
|
|
3f1506 |
|
|
|
3f1506 |
The upcoming minor releases of PostgreSQL cap client_min_messages to
|
|
|
3f1506 |
ERROR to avoid the case this test was testing for. Skip the test if
|
|
|
3f1506 |
client_min_messages doesn't come back as 'fatal' after we set it.
|
|
|
3f1506 |
---
|
|
|
3f1506 |
t/02attribs.t | 23 ++++++++++++++---------
|
|
|
3f1506 |
1 file changed, 14 insertions(+), 9 deletions(-)
|
|
|
3f1506 |
|
|
|
3f1506 |
diff --git a/t/02attribs.t b/t/02attribs.t
|
|
|
3f1506 |
index b9ecd90..75e8f48 100644
|
|
|
3f1506 |
--- a/t/02attribs.t
|
|
|
3f1506 |
+++ b/t/02attribs.t
|
|
|
3f1506 |
@@ -1204,15 +1204,20 @@ $sth->execute();
|
|
|
3f1506 |
is ($warning, undef, $t);
|
|
|
3f1506 |
|
|
|
3f1506 |
## Special case in which errors are not sent to the client!
|
|
|
3f1506 |
-$t = q{When client_min_messages is FATAL, we do our best to alert the caller it's a Bad Idea};
|
|
|
3f1506 |
-$dbh->do(q{SET client_min_messages = 'FATAL'});
|
|
|
3f1506 |
-$dbh->{RaiseError} = 0;
|
|
|
3f1506 |
-$dbh->{AutoCommit} = 1;
|
|
|
3f1506 |
-eval {
|
|
|
3f1506 |
- $dbh->do('SELECT 1 FROM nonesuh');
|
|
|
3f1506 |
-};
|
|
|
3f1506 |
-my $errorstring = $dbh->errstr;
|
|
|
3f1506 |
-like ( $errorstring, qr/Perhaps client_min_messages/, $t);
|
|
|
3f1506 |
+SKIP: {
|
|
|
3f1506 |
+ $t = q{When client_min_messages is FATAL, we do our best to alert the caller it's a Bad Idea};
|
|
|
3f1506 |
+ $dbh->do(q{SET client_min_messages = 'FATAL'});
|
|
|
3f1506 |
+ skip "This version of PostgreSQL caps client_min_messages to ERROR", 1
|
|
|
3f1506 |
+ unless $dbh->selectrow_array('SHOW client_min_messages') eq 'fatal';
|
|
|
3f1506 |
+
|
|
|
3f1506 |
+ $dbh->{RaiseError} = 0;
|
|
|
3f1506 |
+ $dbh->{AutoCommit} = 1;
|
|
|
3f1506 |
+ eval {
|
|
|
3f1506 |
+ $dbh->do('SELECT 1 FROM nonesuh');
|
|
|
3f1506 |
+ };
|
|
|
3f1506 |
+ my $errorstring = $dbh->errstr;
|
|
|
3f1506 |
+ like ( $errorstring, qr/Perhaps client_min_messages/, $t);
|
|
|
3f1506 |
+}
|
|
|
3f1506 |
$dbh->rollback();
|
|
|
3f1506 |
$dbh->do(q{SET client_min_message = 'NOTICE'});
|
|
|
3f1506 |
$dbh->{RaiseError} = 1;
|
|
|
3f1506 |
--
|
|
|
3f1506 |
2.20.1
|
|
|
3f1506 |
|