This is an automated email from the ASF dual-hosted git repository.
gfphoenix78 pushed a commit to branch sync-with-upstream
in repository https://gitbox.apache.org/repos/asf/cloudberry-gpbackup.git
The following commit(s) were added to refs/heads/sync-with-upstream by this
push:
new 78fda017 fix(test): adjust stored procedure test expectations for
Cloudberry (#26)
78fda017 is described below
commit 78fda017373877a8ec0905edd8d0405b08a88a9f
Author: Robert Mu <[email protected]>
AuthorDate: Thu Aug 28 20:35:01 2025 +0800
fix(test): adjust stored procedure test expectations for Cloudberry (#26)
The integration test for stored procedures was failing on Cloudberry
due to differences in pg_get_function_arguments behavior compared to
GPDB 7.
In Cloudberry (PostgreSQL 14), pg_get_function_arguments includes
parameter modes (e.g., "IN") in the returned arguments string, while
GPDB 7 omits them.
This commit updates the test to expect the correct format for each
database version:
- Cloudberry: "IN a integer, IN b integer"
- GPDB 7: "a integer, b integer"
The underlying gpbackup functionality works correctly on both platforms;
only the test expectations needed adjustment.
Fixes: Integration test failure in predata_functions_queries_test.go
---
integration/predata_functions_queries_test.go | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/integration/predata_functions_queries_test.go
b/integration/predata_functions_queries_test.go
index 8b99e05f..72cc7ea5 100644
--- a/integration/predata_functions_queries_test.go
+++ b/integration/predata_functions_queries_test.go
@@ -427,6 +427,16 @@ INSERT INTO public.tbl VALUES (b);
secondProcedure.DataAccess = ""
}
+ // In Cloudberry (PostgreSQL 14+),
pg_get_function_arguments returns the parameter
+ // mode (e.g., 'IN') for procedures, which differs from
GPDB 7. We adjust the
+ // expected values accordingly.
+ if connectionPool.Version.IsCBDB() {
+ firstProcedure.Arguments.String = "IN a
integer, IN b integer"
+ firstProcedure.IdentArgs.String = "IN a
integer, IN b integer"
+ secondProcedure.Arguments.String = "IN a
integer, IN b integer"
+ secondProcedure.IdentArgs.String = "IN a
integer, IN b integer"
+ }
+
Expect(results).To(HaveLen(2))
structmatcher.ExpectStructsToMatchExcluding(&results[0], &firstProcedure, "Oid")
structmatcher.ExpectStructsToMatchExcluding(&results[1], &secondProcedure,
"Oid")
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]