[meta-oe][PATCH 1/1] postresql: fix ptest failure about sysviews


Manoj Saun <manojsingh.saun@...>
 

In postgresql sysview ptest are failing due to hidden debug info in pg_config table.
The information is hidden due to existing patch 0001-config_info.c-not-expose-build-info.patch
So for passing the test we need to reduce the row count in the sysviews test.

Upstream-Status: Inappropriate [oe specific]

Signed-off-by: Manoj Saun <manojsingh.saun@...>
---
...sql-fix-ptest-failure-about-sysviews.patch | 43 +++++++++++++++++++
.../recipes-dbs/postgresql/postgresql_14.5.bb | 1 +
2 files changed, 44 insertions(+)
create mode 100644 meta-oe/recipes-dbs/postgresql/files/0001-postresql-fix-ptest-failure-about-sysviews.patch

diff --git a/meta-oe/recipes-dbs/postgresql/files/0001-postresql-fix-ptest-failure-about-sysviews.patch b/meta-oe/recipes-dbs/postgresql/files/0001-postresql-fix-ptest-failure-about-sysviews.patch
new file mode 100644
index 000000000..224732daf
--- /dev/null
+++ b/meta-oe/recipes-dbs/postgresql/files/0001-postresql-fix-ptest-failure-about-sysviews.patch
@@ -0,0 +1,43 @@
+From c68f036b0f80812a806719dc218dc222eb24259f Mon Sep 17 00:00:00 2001
+From: Manoj Saun <manojsingh.saun@...>
+Date: Tue, 3 Jan 2023 05:45:35 +0000
+Subject: [PATCH] postresql: fix ptest failure about sysviews
+
+The patch "0001-config_info.c-not-expose-build-info.patch" hides the debug info
+in pg_config table which reduces the count of rows from pg_config and leads to
+sysviews test failure.
+To fix it we need to reduce the count of parameters in sysviews test.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Manoj Saun <manojsingh.saun@...>
+---
+ src/test/regress/expected/sysviews.out | 2 +-
+ src/test/regress/sql/sysviews.sql | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/test/regress/expected/sysviews.out b/src/test/regress/expected/sysviews.out
+index 001c6e7eb9..82568989d8 100644
+--- a/src/test/regress/expected/sysviews.out
++++ b/src/test/regress/expected/sysviews.out
+@@ -29,7 +29,7 @@ select name, ident, parent, level, total_bytes >= free_bytes
+ (1 row)
+
+ -- At introduction, pg_config had 23 entries; it may grow
+-select count(*) > 20 as ok from pg_config;
++select count(*) > 13 as ok from pg_config;
+ ok
+ ----
+ t
+diff --git a/src/test/regress/sql/sysviews.sql b/src/test/regress/sql/sysviews.sql
+index 351e469c77..84c113e572 100644
+--- a/src/test/regress/sql/sysviews.sql
++++ b/src/test/regress/sql/sysviews.sql
+@@ -18,7 +18,7 @@ select name, ident, parent, level, total_bytes >= free_bytes
+ from pg_backend_memory_contexts where level = 0;
+
+ -- At introduction, pg_config had 23 entries; it may grow
+-select count(*) > 20 as ok from pg_config;
++select count(*) > 13 as ok from pg_config;
+
+ -- We expect no cursors in this test; see also portals.sql
+ select count(*) = 0 as ok from pg_cursors;
+--
+2.34.1
+
diff --git a/meta-oe/recipes-dbs/postgresql/postgresql_14.5.bb b/meta-oe/recipes-dbs/postgresql/postgresql_14.5.bb
index 1551d3405..9c69b4656 100644
--- a/meta-oe/recipes-dbs/postgresql/postgresql_14.5.bb
+++ b/meta-oe/recipes-dbs/postgresql/postgresql_14.5.bb
@@ -9,6 +9,7 @@ SRC_URI += "\
file://0001-configure.ac-bypass-autoconf-2.69-version-check.patch \
file://remove_duplicate.patch \
file://0001-config_info.c-not-expose-build-info.patch \
+ file://0001-postresql-fix-ptest-failure-about-sysviews.patch \
"

SRC_URI[sha256sum] = "d4f72cb5fb857c9a9f75ec8cf091a1771272802f2178f0b2e65b7b6ff64f4a30"
--
2.34.1