This is an automated email from the ASF dual-hosted git repository.
reshke pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git
The following commit(s) were added to refs/heads/main by this push:
new 18d2ba7083b Fix test modules compile-time issues (#1878)
18d2ba7083b is described below
commit 18d2ba7083bfc59160c24cc895c4a71c981a6ae9
Author: reshke <[email protected]>
AuthorDate: Sun Aug 2 19:11:31 2026 +0500
Fix test modules compile-time issues (#1878)
Fix heap_checksum compile-time issue
---
src/test/heap_checksum/heap_checksum_helper.c | 12 +++----
.../test_copy_callbacks/test_copy_callbacks.c | 4 +--
.../modules/test_ddl_deparse/test_ddl_deparse.c | 41 ++++++++++++++++++++++
.../test_planner/src/planner_test_helpers.c | 6 ++--
4 files changed, 52 insertions(+), 11 deletions(-)
diff --git a/src/test/heap_checksum/heap_checksum_helper.c
b/src/test/heap_checksum/heap_checksum_helper.c
index d5ac4fa5cf0..702a8f4de2e 100644
--- a/src/test/heap_checksum/heap_checksum_helper.c
+++ b/src/test/heap_checksum/heap_checksum_helper.c
@@ -6,13 +6,13 @@
* src/test/heap_checksum/heap_checksum_helper.c
*--------------------------------------------------------------------------
*/
-#include "c.h"
#include "postgres.h"
#include "funcapi.h"
#include "nodes/pg_list.h"
#include "storage/buf_internals.h"
#include "storage/bufmgr.h"
#include "access/xlog.h"
+#include "access/xlogutils.h"
#ifdef PG_MODULE_MAGIC
PG_MODULE_MAGIC;
@@ -25,17 +25,17 @@ Datum
invalidate_buffers(PG_FUNCTION_ARGS)
{
SMgrRelation reln = (SMgrRelation) palloc(sizeof(SMgrRelationData));
- RelFileNodeBackend rnodebackend;
+ RelFileLocatorBackend rnodebackend;
ForkNumber forknum = MAIN_FORKNUM;
BlockNumber firstDelBlock = 0;
- rnodebackend.node.spcNode = PG_GETARG_OID(0);
- rnodebackend.node.dbNode = PG_GETARG_OID(1);
- rnodebackend.node.relNode = PG_GETARG_OID(2);
+ rnodebackend.locator.spcOid = PG_GETARG_OID(0);
+ rnodebackend.locator.dbOid = PG_GETARG_OID(1);
+ rnodebackend.locator.relNumber = PG_GETARG_OID(2);
rnodebackend.backend = InvalidBackendId; /* not temporary/local */
Assert(!InRecovery); /* can't be used in recovery mode */
- reln->smgr_rnode = rnodebackend;
+ reln->smgr_rlocator = rnodebackend;
DropRelFileNodeBuffers(reln, &forknum, 1, &firstDelBlock);
pfree(reln);
diff --git a/src/test/modules/test_copy_callbacks/test_copy_callbacks.c
b/src/test/modules/test_copy_callbacks/test_copy_callbacks.c
index e65771067ea..2f1a4b795f5 100644
--- a/src/test/modules/test_copy_callbacks/test_copy_callbacks.c
+++ b/src/test/modules/test_copy_callbacks/test_copy_callbacks.c
@@ -35,12 +35,12 @@ test_copy_to_callback(PG_FUNCTION_ARGS)
{
Relation rel = table_open(PG_GETARG_OID(0), AccessShareLock);
CopyToState cstate;
- int64 processed;
+ uint64 processed;
cstate = BeginCopyTo(NULL, rel, NULL, RelationGetRelid(rel), NULL,
false,
to_cb, NIL, NIL);
processed = DoCopyTo(cstate);
- EndCopyTo(cstate);
+ EndCopyTo(cstate, &processed);
ereport(NOTICE, (errmsg("COPY TO callback has processed %lld rows",
(long long)
processed)));
diff --git a/src/test/modules/test_ddl_deparse/test_ddl_deparse.c
b/src/test/modules/test_ddl_deparse/test_ddl_deparse.c
index b1f45ddb186..1b74768a72a 100644
--- a/src/test/modules/test_ddl_deparse/test_ddl_deparse.c
+++ b/src/test/modules/test_ddl_deparse/test_ddl_deparse.c
@@ -151,6 +151,7 @@ get_altertable_subcmdinfo(PG_FUNCTION_ARGS)
strtype = "SET COMPRESSION";
break;
case AT_DropColumn:
+ case AT_DropColumnRecurse:
strtype = "DROP COLUMN";
break;
case AT_AddIndex:
@@ -160,6 +161,7 @@ get_altertable_subcmdinfo(PG_FUNCTION_ARGS)
strtype = "(re) ADD INDEX";
break;
case AT_AddConstraint:
+ case AT_AddConstraintRecurse:
strtype = "ADD CONSTRAINT";
break;
case AT_ReAddConstraint:
@@ -172,12 +174,14 @@ get_altertable_subcmdinfo(PG_FUNCTION_ARGS)
strtype = "ALTER CONSTRAINT";
break;
case AT_ValidateConstraint:
+ case AT_ValidateConstraintRecurse:
strtype = "VALIDATE CONSTRAINT";
break;
case AT_AddIndexConstraint:
strtype = "ADD CONSTRAINT (using index)";
break;
case AT_DropConstraint:
+ case AT_DropConstraintRecurse:
strtype = "DROP CONSTRAINT";
break;
case AT_ReAddComment:
@@ -315,6 +319,43 @@ get_altertable_subcmdinfo(PG_FUNCTION_ARGS)
case AT_ReAddStatistics:
strtype = "(re) ADD STATS";
break;
+ /* Cloudberry addons */
+ case AT_SetDistributedBy:
+ strtype = "SET DISTRIBUTED BY";
+ break;
+ case AT_ExpandTable:
+ strtype = "EXPAND TABLE";
+ break;
+ case AT_ExpandPartitionTablePrepare:
+ strtype = "EXPAND PARTITION TABLE PREPARE";
+ break;
+ case AT_ShrinkTable:
+ strtype = "SHRINK TABLE";
+ break;
+ case AT_PartAdd:
+ strtype = "PART ADD";
+ break;
+ case AT_PartAlter:
+ strtype = "PART ALTER";
+ break;
+ case AT_PartDrop:
+ strtype = "PART DROP";
+ break;
+ case AT_PartExchange:
+ strtype = "PART EXCHANGE";
+ break;
+ case AT_PartRename:
+ strtype = "PART RENAME";
+ break;
+ case AT_PartSetTemplate:
+ strtype = "PART SET TEMPLATE";
+ break;
+ case AT_PartSplit:
+ strtype = "PART SPLIT";
+ break;
+ case AT_PartTruncate:
+ strtype = "PART TRUNCATE";
+ break;
}
if (subcmd->recurse)
diff --git a/src/test/modules/test_planner/src/planner_test_helpers.c
b/src/test/modules/test_planner/src/planner_test_helpers.c
index 34fe94b79c4..514f84099cb 100644
--- a/src/test/modules/test_planner/src/planner_test_helpers.c
+++ b/src/test/modules/test_planner/src/planner_test_helpers.c
@@ -12,9 +12,9 @@ get_parsetree_for(const char *query_string)
}
static Query *
-get_query_for_parsetree(Node *parsetree, const char *query_string)
+get_query_for_parsetree(RawStmt *parsetree, const char *query_string)
{
- List *querytree_list = pg_analyze_and_rewrite(parsetree, query_string,
NULL, 0, NULL);
+ List *querytree_list = pg_analyze_and_rewrite_fixedparams(parsetree,
query_string, NULL, 0, NULL);
ListCell *querytree = list_head(querytree_list);
return (Query *)lfirst(querytree);
}
@@ -22,7 +22,7 @@ get_query_for_parsetree(Node *parsetree, const char
*query_string)
Query *
make_query(const char *query_string)
{
- Node *parsetree = get_parsetree_for(query_string);
+ RawStmt *parsetree = get_parsetree_for(query_string);
return get_query_for_parsetree(parsetree, query_string);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]