From d309a85b51d732cb983ea781b69a9a1d2d4a1831 Mon Sep 17 00:00:00 2001 From: David Steele Date: Tue, 5 Jun 2018 08:59:17 -0400 Subject: [PATCH] PostgreSQL 11 Beta 1 support. --- doc/xml/release.xml | 6 ++++++ lib/pgBackRest/Archive/Common.pm | 1 + lib/pgBackRest/Db.pm | 4 ++++ lib/pgBackRest/DbVersion.pm | 4 +++- src/perl/embed.auto.c | 9 ++++++++- src/postgres/info.c | 4 +++- test/lib/pgBackRestTest/Common/ContainerTest.pm | 3 ++- test/lib/pgBackRestTest/Common/VmTest.pm | 2 ++ test/src/module/postgres/infoTest.c | 2 ++ 9 files changed, 31 insertions(+), 4 deletions(-) diff --git a/doc/xml/release.xml b/doc/xml/release.xml index 1473fef63..9c64dca58 100644 --- a/doc/xml/release.xml +++ b/doc/xml/release.xml @@ -14,6 +14,12 @@ + + +

11 Beta 1 support.

+
+
+

Split log levels into separate header file. Many modules that use debug.h do not need to do logging so this reduces dependencies for those modules.

diff --git a/lib/pgBackRest/Archive/Common.pm b/lib/pgBackRest/Archive/Common.pm index 23807a6f0..b6e118d6a 100644 --- a/lib/pgBackRest/Archive/Common.pm +++ b/lib/pgBackRest/Archive/Common.pm @@ -67,6 +67,7 @@ my $oWalMagicHash = hex('0xD087') => PG_VERSION_95, hex('0xD093') => PG_VERSION_96, hex('0xD097') => PG_VERSION_10, + hex('0xD098') => PG_VERSION_11, }; #################################################################################################################################### diff --git a/lib/pgBackRest/Db.pm b/lib/pgBackRest/Db.pm index 98bcbd3a9..9b2215b47 100644 --- a/lib/pgBackRest/Db.pm +++ b/lib/pgBackRest/Db.pm @@ -63,6 +63,10 @@ my $oPgControlVersionHash = { 201707211 => PG_VERSION_10, }, + 1100 => + { + 201804191 => PG_VERSION_11, + }, }; #################################################################################################################################### diff --git a/lib/pgBackRest/DbVersion.pm b/lib/pgBackRest/DbVersion.pm index 0b9fd0c52..9f935052f 100644 --- a/lib/pgBackRest/DbVersion.pm +++ b/lib/pgBackRest/DbVersion.pm @@ -47,6 +47,8 @@ use constant PG_VERSION_96 => '9.6'; push @EXPORT, qw(PG_VERSION_96); use constant PG_VERSION_10 => '10'; push @EXPORT, qw(PG_VERSION_10); +use constant PG_VERSION_11 => '11'; + push @EXPORT, qw(PG_VERSION_11); use constant PG_VERSION_APPLICATION_NAME => PG_VERSION_90; push @EXPORT, qw(PG_VERSION_APPLICATION_NAME); @@ -66,7 +68,7 @@ sub versionSupport my ($strOperation) = logDebugParam(__PACKAGE__ . '->versionSupport'); my @strySupportVersion = (PG_VERSION_83, PG_VERSION_84, PG_VERSION_90, PG_VERSION_91, PG_VERSION_92, PG_VERSION_93, - PG_VERSION_94, PG_VERSION_95, PG_VERSION_96, PG_VERSION_10); + PG_VERSION_94, PG_VERSION_95, PG_VERSION_96, PG_VERSION_10, PG_VERSION_11); # Return from function and log return values if any return logDebugReturn diff --git a/src/perl/embed.auto.c b/src/perl/embed.auto.c index 7931fe843..1f9100489 100644 --- a/src/perl/embed.auto.c +++ b/src/perl/embed.auto.c @@ -142,6 +142,7 @@ static const EmbeddedModule embeddedModule[] = "hex('0xD087') => PG_VERSION_95,\n" "hex('0xD093') => PG_VERSION_96,\n" "hex('0xD097') => PG_VERSION_10,\n" + "hex('0xD098') => PG_VERSION_11,\n" "};\n" "\n" "\n" @@ -10377,6 +10378,10 @@ static const EmbeddedModule embeddedModule[] = "{\n" "201707211 => PG_VERSION_10,\n" "},\n" + "1100 =>\n" + "{\n" + "201804191 => PG_VERSION_11,\n" + "},\n" "};\n" "\n" "\n" @@ -11537,6 +11542,8 @@ static const EmbeddedModule embeddedModule[] = "push @EXPORT, qw(PG_VERSION_96);\n" "use constant PG_VERSION_10 => '10';\n" "push @EXPORT, qw(PG_VERSION_10);\n" + "use constant PG_VERSION_11 => '11';\n" + "push @EXPORT, qw(PG_VERSION_11);\n" "\n" "use constant PG_VERSION_APPLICATION_NAME => PG_VERSION_90;\n" "push @EXPORT, qw(PG_VERSION_APPLICATION_NAME);\n" @@ -11556,7 +11563,7 @@ static const EmbeddedModule embeddedModule[] = "my ($strOperation) = logDebugParam(__PACKAGE__ . '->versionSupport');\n" "\n" "my @strySupportVersion = (PG_VERSION_83, PG_VERSION_84, PG_VERSION_90, PG_VERSION_91, PG_VERSION_92, PG_VERSION_93,\n" - "PG_VERSION_94, PG_VERSION_95, PG_VERSION_96, PG_VERSION_10);\n" + "PG_VERSION_94, PG_VERSION_95, PG_VERSION_96, PG_VERSION_10, PG_VERSION_11);\n" "\n" "\n" "return logDebugReturn\n" diff --git a/src/postgres/info.c b/src/postgres/info.c index 296208936..82cf7e6db 100644 --- a/src/postgres/info.c +++ b/src/postgres/info.c @@ -22,7 +22,9 @@ pgVersionMap(uint32_t controlVersion, uint32_t catalogVersion) uint result = 0; - if (controlVersion == 1002 && catalogVersion == 201707211) + if (controlVersion == 1100 && catalogVersion == 201804191) + result = PG_VERSION_11; + else if (controlVersion == 1002 && catalogVersion == 201707211) result = PG_VERSION_10; else if (controlVersion == 960 && catalogVersion == 201608131) result = PG_VERSION_96; diff --git a/test/lib/pgBackRestTest/Common/ContainerTest.pm b/test/lib/pgBackRestTest/Common/ContainerTest.pm index 5d8bc33bb..6b609378e 100755 --- a/test/lib/pgBackRestTest/Common/ContainerTest.pm +++ b/test/lib/pgBackRestTest/Common/ContainerTest.pm @@ -466,7 +466,8 @@ sub containerBuild { $strScript .= " echo 'deb http://apt.postgresql.org/pub/repos/apt/ " . - $$oVm{$strOS}{&VM_OS_REPO} . "-pgdg main' >> /etc/apt/sources.list.d/pgdg.list && \\\n" . + $$oVm{$strOS}{&VM_OS_REPO} . '-pgdg main' . ($strOS ne VM_U12 ? ' 11' : '') . + "' >> /etc/apt/sources.list.d/pgdg.list && \\\n" . " wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \\\n" . " apt-get update"; } diff --git a/test/lib/pgBackRestTest/Common/VmTest.pm b/test/lib/pgBackRestTest/Common/VmTest.pm index edca6f229..ec89ed780 100644 --- a/test/lib/pgBackRestTest/Common/VmTest.pm +++ b/test/lib/pgBackRestTest/Common/VmTest.pm @@ -243,12 +243,14 @@ my $oyVm = PG_VERSION_94, PG_VERSION_95, PG_VERSION_10, + PG_VERSION_11, ], &VM_DB_TEST => [ PG_VERSION_94, PG_VERSION_10, + PG_VERSION_11, ], }, }; diff --git a/test/src/module/postgres/infoTest.c b/test/src/module/postgres/infoTest.c index e34149c76..8cc3335ee 100644 --- a/test/src/module/postgres/infoTest.c +++ b/test/src/module/postgres/infoTest.c @@ -25,6 +25,7 @@ testRun() TEST_RESULT_INT(pgVersionMap( 942, 201510051), PG_VERSION_95, " check version 9.5"); TEST_RESULT_INT(pgVersionMap( 960, 201608131), PG_VERSION_96, " check version 9.6"); TEST_RESULT_INT(pgVersionMap(1002, 201707211), PG_VERSION_10, " check version 10"); + TEST_RESULT_INT(pgVersionMap(1100, 201804191), PG_VERSION_11, " check version 11"); // ------------------------------------------------------------------------------------------------------------------------- #define MAP_ERROR \ @@ -40,6 +41,7 @@ testRun() TEST_ERROR_FMT(pgVersionMap( 942, 0), VersionNotSupportedError, MAP_ERROR, 942); TEST_ERROR_FMT(pgVersionMap( 960, 0), VersionNotSupportedError, MAP_ERROR, 960); TEST_ERROR_FMT(pgVersionMap(1002, 0), VersionNotSupportedError, MAP_ERROR, 1002); + TEST_ERROR_FMT(pgVersionMap(1100, 0), VersionNotSupportedError, MAP_ERROR, 1100); } // -----------------------------------------------------------------------------------------------------------------------------