Package: asyncpg Version: 0.17.0-1 Followup-For: Bug #911876 User: ubuntu-de...@lists.ubuntu.com Usertags: origin-ubuntu disco ubuntu-patch
Dear Maintainer, In Ubuntu, the attached patch was applied to achieve the following: * d/p/fix-large-oid-test.patch: Grab patch from upstream Git to fix large OID test with PostgreSQL 11. Thanks for considering the patch. Logan Rosen -- System Information: Debian Release: buster/sid APT prefers cosmic-updates APT policy: (500, 'cosmic-updates'), (500, 'cosmic-security'), (500, 'cosmic') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 4.18.0-10-generic (SMP w/8 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled
diff -Nru asyncpg-0.17.0/debian/patches/fix-large-oid-test.patch asyncpg-0.17.0/debian/patches/fix-large-oid-test.patch --- asyncpg-0.17.0/debian/patches/fix-large-oid-test.patch 1969-12-31 19:00:00.000000000 -0500 +++ asyncpg-0.17.0/debian/patches/fix-large-oid-test.patch 2018-11-19 22:00:06.000000000 -0500 @@ -0,0 +1,47 @@ +From ddb0ec2918c370ba6fc2f569835fd02078132058 Mon Sep 17 00:00:00 2001 +From: Elvis Pranskevichus <el...@magic.io> +Date: Mon, 22 Oct 2018 19:07:06 -0400 +Subject: [PATCH] Fix large OID test under PostgreSQL 11 + +PostgreSQL 11 seems to be automatically creating array types for domains +with OIDs that _precede_ the OID of the array element type, so +the large OID test trips over with an off-by-one assertion error. +--- + tests/test_codecs.py | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/tests/test_codecs.py b/tests/test_codecs.py +index 9aac5ea..5498b40 100644 +--- a/tests/test_codecs.py ++++ b/tests/test_codecs.py +@@ -1727,10 +1727,12 @@ def _decoder(value): + + @unittest.skipIf(os.environ.get('PGHOST'), 'using remote cluster for testing') + class TestCodecsLargeOIDs(tb.ConnectedTestCase): ++ LARGE_OID = 2147483648 ++ + @classmethod + def setup_cluster(cls): + cls.cluster = cls.new_cluster(pg_cluster.TempCluster) +- cls.cluster.reset_wal(oid=2147483648) ++ cls.cluster.reset_wal(oid=cls.LARGE_OID) + cls.start_cluster(cls.cluster) + + async def test_custom_codec_large_oid(self): +@@ -1739,7 +1741,15 @@ def setup_cluster(cls): + oid = await self.con.fetchval(''' + SELECT oid FROM pg_type WHERE typname = 'test_domain_t' + ''') +- self.assertEqual(oid, 2147483648) ++ ++ expected_oid = self.LARGE_OID ++ if self.server_version >= (11, 0): ++ # PostgreSQL 11 automatically create a domain array type ++ # _before_ the domain type, so the expected OID is ++ # off by one. ++ expected_oid += 1 ++ ++ self.assertEqual(oid, expected_oid) + + # Test that introspection handles large OIDs + v = await self.con.fetchval('SELECT $1::test_domain_t', 10) diff -Nru asyncpg-0.17.0/debian/patches/series asyncpg-0.17.0/debian/patches/series --- asyncpg-0.17.0/debian/patches/series 1969-12-31 19:00:00.000000000 -0500 +++ asyncpg-0.17.0/debian/patches/series 2018-11-19 22:00:15.000000000 -0500 @@ -0,0 +1 @@ +fix-large-oid-test.patch