Update to pg 1.0.0.

This commit is contained in:
Vít Ondruch 2018-02-13 12:31:35 +01:00
parent 273cbffbf7
commit be5aaac754
5 changed files with 15 additions and 78 deletions

1
.gitignore vendored
View File

@ -7,3 +7,4 @@
/pg-0.18.4.gem /pg-0.18.4.gem
/pg-0.20.0.gem /pg-0.20.0.gem
/pg-0.21.0.gem /pg-0.21.0.gem
/pg-1.0.0.gem

View File

@ -1,7 +1,7 @@
diff --git a/ext/extconf.rb b/ext/extconf.rb diff --git a/ext/extconf.rb b/ext/extconf.rb
--- a/ext/extconf.rb --- a/ext/extconf.rb
+++ b/ext/extconf.rb +++ b/ext/extconf.rb
@@ -29,13 +29,6 @@ @@ -33,13 +33,6 @@
incdir = `"#{pgconfig}" --includedir`.chomp incdir = `"#{pgconfig}" --includedir`.chomp
libdir = `"#{pgconfig}" --libdir`.chomp libdir = `"#{pgconfig}" --libdir`.chomp
dir_config 'pg', incdir, libdir dir_config 'pg', incdir, libdir

View File

@ -1,57 +0,0 @@
From 55ca6dd8c1e0925f617b8f9e9042cbea01cf0eb8 Mon Sep 17 00:00:00 2001
From: Lars Kanis <kanis@comcard.de>
Date: Mon, 23 Oct 2017 13:02:45 +0200
Subject: [PATCH] Adjust tests for PostgreSQL-10
---
spec/helpers.rb | 2 +-
spec/pg/connection_spec.rb | 13 +++++++++----
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/spec/helpers.rb b/spec/helpers.rb
index d13df5e..e9856de 100755
--- a/spec/helpers.rb
+++ b/spec/helpers.rb
@@ -251,7 +251,7 @@ module PG::TestingHelpers
def check_for_lingering_connections( conn )
conn.exec( "SELECT * FROM pg_stat_activity" ) do |res|
- conns = res.find_all {|row| row['pid'].to_i != conn.backend_pid }
+ conns = res.find_all {|row| row['pid'].to_i != conn.backend_pid && ["client backend", nil].include?(row["backend_type"]) }
unless conns.empty?
puts "Lingering connections remain:"
conns.each do |row|
diff --git a/spec/pg/connection_spec.rb b/spec/pg/connection_spec.rb
index d055673..0924ca4 100755
--- a/spec/pg/connection_spec.rb
+++ b/spec/pg/connection_spec.rb
@@ -219,7 +219,7 @@ describe PG::Connection do
described_class.connect(@conninfo).finish
sleep 0.5
res = @conn.exec(%[SELECT COUNT(*) AS n FROM pg_stat_activity
- WHERE usename IS NOT NULL])
+ WHERE usename IS NOT NULL AND application_name != ''])
# there's still the global @conn, but should be no more
expect( res[0]['n'] ).to eq( '1' )
end
@@ -1524,9 +1524,14 @@ describe PG::Connection do
end
it "shouldn't type map params unless requested" do
- expect{
- @conn.exec_params( "SELECT $1", [5] )
- }.to raise_error(PG::IndeterminateDatatype)
+ if @conn.server_version < 100000
+ expect{
+ @conn.exec_params( "SELECT $1", [5] )
+ }.to raise_error(PG::IndeterminateDatatype)
+ else
+ # PostgreSQL-10 maps to TEXT type (OID 25)
+ expect( @conn.exec_params( "SELECT $1", [5] ).ftype(0)).to eq(25)
+ end
end
it "should raise an error on invalid encoder to put_copy_data" do
--
2.14.3

View File

@ -2,8 +2,8 @@
%global gem_name pg %global gem_name pg
Name: rubygem-%{gem_name} Name: rubygem-%{gem_name}
Version: 0.21.0 Version: 1.0.0
Release: 5%{?dist} Release: 1%{?dist}
Summary: A Ruby interface to the PostgreSQL RDBMS Summary: A Ruby interface to the PostgreSQL RDBMS
# Upstream license clarification (https://bitbucket.org/ged/ruby-pg/issue/72/) # Upstream license clarification (https://bitbucket.org/ged/ruby-pg/issue/72/)
# #
@ -16,9 +16,6 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
# Disable RPATH. # Disable RPATH.
# https://bitbucket.org/ged/ruby-pg/issue/183 # https://bitbucket.org/ged/ruby-pg/issue/183
Patch0: rubygem-pg-0.17.1-remove-rpath.patch Patch0: rubygem-pg-0.17.1-remove-rpath.patch
# Fix tests for PostgreSQL-10.
# https://github.com/ged/ruby-pg/commit/fe24a71
Patch1: rubygem-pg-0.21.0-adjust-tests-for-postgresql-10.patch
BuildRequires: ruby(release) BuildRequires: ruby(release)
BuildRequires: rubygems-devel BuildRequires: rubygems-devel
BuildRequires: ruby-devel BuildRequires: ruby-devel
@ -43,17 +40,13 @@ BuildArch: noarch
Documentation for %{name}. Documentation for %{name}.
%prep %prep
gem unpack %{SOURCE0} %setup -q -n %{gem_name}-%{version}
%setup -q -D -T -n %{gem_name}-%{version}
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
%patch0 -p1 %patch0 -p1
%build %build
# Create the gem as gem install only works on a gem file # Create the gem as gem install only works on a gem file
gem build %{gem_name}.gemspec gem build ../%{gem_name}-%{version}.gemspec
# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir # %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
# by default, so that we can move it into the buildroot in %%install # by default, so that we can move it into the buildroot in %%install
@ -91,12 +84,9 @@ done
%check %check
pushd .%{gem_instdir} pushd .%{gem_instdir}
cat "%{PATCH1}" | patch -p1
# Set LANG to prevent encoding warnings. See spec/pg/connection_spec.rb
# test case: "receives properly encoded messages in the notice callbacks".
# Set --verbose to show detail log by $VERBOSE. # Set --verbose to show detail log by $VERBOSE.
# See https://github.com/ged/ruby-pg/blob/master/spec/helpers.rb $VERBOSE # See https://github.com/ged/ruby-pg/blob/master/spec/helpers.rb $VERBOSE
LANG=en_US.UTF-8 ruby -S --verbose \ ruby -S --verbose \
rspec -I$(dirs +1)%{gem_extdir_mri} -f d spec rspec -I$(dirs +1)%{gem_extdir_mri} -f d spec
popd popd
@ -125,6 +115,9 @@ popd
%{gem_instdir}/spec %{gem_instdir}/spec
%changelog %changelog
* Tue Feb 13 2018 Vít Ondruch <vondruch@redhat.com> - 1.0.0-1
- Update to pg 1.0.0.
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.21.0-5 * Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.21.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
@ -138,7 +131,7 @@ popd
- Fix failed tests for PostgreSQL-10. - Fix failed tests for PostgreSQL-10.
* Thu Aug 17 2017 Vít Ondruch <vondruch@redhat.com> - 0.21.0-1 * Thu Aug 17 2017 Vít Ondruch <vondruch@redhat.com> - 0.21.0-1
- Update to pg 1.21.0. - Update to pg 0.21.0.
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.20.0-3 * Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.20.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
@ -147,7 +140,7 @@ popd
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Mon May 29 2017 Vít Ondruch <vondruch@redhat.com> - 0.20.0-1 * Mon May 29 2017 Vít Ondruch <vondruch@redhat.com> - 0.20.0-1
- Update to pg 1.20.0. - Update to pg 0.20.0.
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.18.4-4 * Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.18.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
@ -161,10 +154,10 @@ popd
* Wed Jan 06 2016 Vít Ondruch <vondruch@redhat.com> - 0.18.4-1 * Wed Jan 06 2016 Vít Ondruch <vondruch@redhat.com> - 0.18.4-1
- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.3 - Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.3
- Update to pg 1.18.4. - Update to pg 0.18.4.
* Wed Aug 26 2015 Vít Ondruch <vondruch@redhat.com> - 0.18.2-1 * Wed Aug 26 2015 Vít Ondruch <vondruch@redhat.com> - 0.18.2-1
- Update to pg 1.18.2. - Update to pg 0.18.2.
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.18.1-2 * Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.18.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (pg-0.21.0.gem) = 590a8c34487d2cf030082cfff87b2cc83b636df06a931e394acfb098ecb5728e793d777f125b036ee9953bbd21ec5facf91c932930acccb507d3394f2fc4cc5b SHA512 (pg-1.0.0.gem) = 1cac025ab8a95b4429534b98377eedeb1e3f8b2c4a859363c4174d477577caf39557b002cde4e745189fa9a29e9181ff9d564d822f15ff5c4f03f7389b0d0398