package rectification
This commit is contained in:
parent
a6a8751174
commit
5ff4346bb6
@ -0,0 +1,50 @@
|
||||
From 2b60151aea6f03ac7e846aae0d21e7f335cad99c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Dagfinn=20Ilmari=20Manns=C3=A5ker?= <ilmari@ilmari.org>
|
||||
Date: Wed, 9 Jan 2019 21:24:09 +0000
|
||||
Subject: [PATCH] Fix client_min_messages=FATAL test on upcoming PostgreSQL
|
||||
releases
|
||||
|
||||
The upcoming minor releases of PostgreSQL cap client_min_messages to
|
||||
ERROR to avoid the case this test was testing for. Skip the test if
|
||||
client_min_messages doesn't come back as 'fatal' after we set it.
|
||||
---
|
||||
t/02attribs.t | 23 ++++++++++++++---------
|
||||
1 file changed, 14 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/t/02attribs.t b/t/02attribs.t
|
||||
index b9ecd90..75e8f48 100644
|
||||
--- a/t/02attribs.t
|
||||
+++ b/t/02attribs.t
|
||||
@@ -1204,15 +1204,20 @@ $sth->execute();
|
||||
is ($warning, undef, $t);
|
||||
|
||||
## Special case in which errors are not sent to the client!
|
||||
-$t = q{When client_min_messages is FATAL, we do our best to alert the caller it's a Bad Idea};
|
||||
-$dbh->do(q{SET client_min_messages = 'FATAL'});
|
||||
-$dbh->{RaiseError} = 0;
|
||||
-$dbh->{AutoCommit} = 1;
|
||||
-eval {
|
||||
- $dbh->do('SELECT 1 FROM nonesuh');
|
||||
-};
|
||||
-my $errorstring = $dbh->errstr;
|
||||
-like ( $errorstring, qr/Perhaps client_min_messages/, $t);
|
||||
+SKIP: {
|
||||
+ $t = q{When client_min_messages is FATAL, we do our best to alert the caller it's a Bad Idea};
|
||||
+ $dbh->do(q{SET client_min_messages = 'FATAL'});
|
||||
+ skip "This version of PostgreSQL caps client_min_messages to ERROR", 1
|
||||
+ unless $dbh->selectrow_array('SHOW client_min_messages') eq 'fatal';
|
||||
+
|
||||
+ $dbh->{RaiseError} = 0;
|
||||
+ $dbh->{AutoCommit} = 1;
|
||||
+ eval {
|
||||
+ $dbh->do('SELECT 1 FROM nonesuh');
|
||||
+ };
|
||||
+ my $errorstring = $dbh->errstr;
|
||||
+ like ( $errorstring, qr/Perhaps client_min_messages/, $t);
|
||||
+}
|
||||
$dbh->rollback();
|
||||
$dbh->do(q{SET client_min_message = 'NOTICE'});
|
||||
$dbh->{RaiseError} = 1;
|
||||
--
|
||||
2.20.1
|
||||
|
||||
BIN
DBD-Pg-3.7.4.tar.gz
Normal file
BIN
DBD-Pg-3.7.4.tar.gz
Normal file
Binary file not shown.
53
perl-DBD-Pg.spec
Normal file
53
perl-DBD-Pg.spec
Normal file
@ -0,0 +1,53 @@
|
||||
Name: perl-DBD-Pg
|
||||
Version: 3.7.4
|
||||
Release: 6
|
||||
Summary: DBD::Pg-PostgreSQL database driver for the DBI module
|
||||
License: GPLv2+ or Artistic
|
||||
Source0: https://cpan.metacpan.org/authors/id/T/TU/TURNSTEP/DBD-Pg-%{version}.tar.gz
|
||||
URL: https://metacpan.org/release/DBD-Pg
|
||||
Patch0000: DBD-Pg-3.7.4-Fix-client_min_messages-FATAL-test-on-upcoming-Postg.patch
|
||||
|
||||
BuildRequires: findutils gcc make perl-devel perl-generators perl-interpreter perl(Carp) perl(Config)
|
||||
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 perl(File::Spec) perl(lib) perl(strict) perl(vars)
|
||||
BuildRequires: perl(warnings) postgresql-devel >= 7.4 perl(DBI) >= 1.614 perl(DynaLoader) perl(Exporter)
|
||||
BuildRequires: perl(if) perl(version) perl(charnames) perl(constant) perl(Cwd) perl(Data::Dumper) perl(open)
|
||||
BuildRequires: perl(POSIX) perl(Test::More) >= 0.88 perl(Test::Simple) perl(Time::HiRes) perl(utf8)
|
||||
BuildRequires: postgresql-server perl(Encode) perl(File::Temp)
|
||||
|
||||
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) perl(DBI) >= 1.614
|
||||
|
||||
%description
|
||||
DBD::Pg-PostgreSQL database driver for the DBI module
|
||||
|
||||
%package help
|
||||
Summary: Help doctment for the perl-DBD-Pg package
|
||||
|
||||
%description help
|
||||
Help doctment for the perl-DBD-Pg package
|
||||
|
||||
%prep
|
||||
%autosetup -n DBD-Pg-%{version} -p1
|
||||
|
||||
%build
|
||||
perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS" NO_PACKLIST=1
|
||||
%make_build
|
||||
|
||||
%install
|
||||
make pure_install DESTDIR=$RPM_BUILD_ROOT
|
||||
%{_fixperms} $RPM_BUILD_ROOT/*
|
||||
|
||||
%check
|
||||
make test
|
||||
|
||||
%files
|
||||
%{perl_vendorarch}/DBD/
|
||||
%{perl_vendorarch}/auto/DBD/
|
||||
%{perl_vendorarch}/Bundle/DBD/Pg.pm
|
||||
|
||||
%files help
|
||||
%doc Changes README README.dev TODO
|
||||
%{_mandir}/man3/*.3*
|
||||
|
||||
%changelog
|
||||
* Fri Apr 24 2020 songzhenyu<songzhenyu@huawei.com> - 3.7.4-6
|
||||
- Package init
|
||||
4
perl-DBD-Pg.yaml
Normal file
4
perl-DBD-Pg.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
version_control: metacpan
|
||||
src_repo: DBD-Pg
|
||||
tag_prefix: ^
|
||||
seperator: .
|
||||
Loading…
x
Reference in New Issue
Block a user