This is an automated email from the ASF dual-hosted git repository.
chenjinbao1989 pushed a commit to branch cbdb-postgres-merge
in repository https://gitbox.apache.org/repos/asf/cloudberry.git
The following commit(s) were added to refs/heads/cbdb-postgres-merge by this
push:
new ada2e14d59f Fix compile errors for commands
ada2e14d59f is described below
commit ada2e14d59fe3a09ed8c6910cc4b00e6a388fb16
Author: Jinbao Chen <[email protected]>
AuthorDate: Fri Oct 3 19:45:23 2025 +0800
Fix compile errors for commands
---
src/backend/commands/dropcmds.c | 6 ++++++
src/backend/commands/explain.c | 8 +++-----
src/backend/commands/functioncmds.c | 12 +++++++++---
src/backend/commands/indexcmds.c | 7 ++-----
src/backend/commands/matview.c | 2 +-
src/backend/commands/prepare.c | 5 ++---
src/backend/commands/publicationcmds.c | 35 +---------------------------------
src/backend/commands/sequence.c | 8 ++++----
src/include/nodes/nodes.h | 1 +
src/include/portability/instr_time.h | 2 +-
10 files changed, 30 insertions(+), 56 deletions(-)
diff --git a/src/backend/commands/dropcmds.c b/src/backend/commands/dropcmds.c
index b8d1a10bc68..9dc12b13eea 100644
--- a/src/backend/commands/dropcmds.c
+++ b/src/backend/commands/dropcmds.c
@@ -520,6 +520,12 @@ does_not_exist_skipping(ObjectType objtype, Node *object)
case OBJECT_PUBLICATION_REL:
case OBJECT_TABCONSTRAINT:
case OBJECT_USER_MAPPING:
+ case OBJECT_PROFILE:
+ case OBJECT_TAG:
+ case OBJECT_STORAGE_USER_MAPPING:
+ case OBJECT_RESQUEUE:
+ case OBJECT_RESGROUP:
+ case OBJECT_DIRECTORY_TABLE:
/* These are currently not used or needed. */
elog(ERROR, "unsupported object type: %d", (int)
objtype);
break;
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
index e1a42e5ad86..33259c839af 100644
--- a/src/backend/commands/explain.c
+++ b/src/backend/commands/explain.c
@@ -306,7 +306,7 @@ ExplainQuery(ParseState *pstate, ExplainStmt *stmt,
query = castNode(Query, stmt->query);
if (IsQueryIdEnabled())
- jstate = JumbleQuery(query);
+ jstate = JumbleQuery(query, pstate->p_sourcetext);
if (post_parse_analyze_hook)
(*post_parse_analyze_hook) (pstate, query, jstate);
@@ -2551,7 +2551,7 @@ ExplainNode(PlanState *planstate, List *ancestors,
char *buf;
Oid relid;
relid = rt_fetch(((DynamicSeqScan *)plan)
- ->seqscan.scanrelid,
+
->seqscan.scan.scanrelid,
es->rtable)->relid;
buf = psprintf("(out of %d)",
countLeafPartTables(relid));
ExplainPropertyInteger(
@@ -2788,6 +2788,7 @@ ExplainNode(PlanState *planstate, List *ancestors,
planstate, es);
show_upper_qual(((WindowAgg *) plan)->runConditionOrig,
"Run Condition",
planstate, ancestors, es);
+ show_windowagg_keys((WindowAggState *) planstate,
ancestors, es);
break;
#if 0 /* Group node has been disabled in GPDB */
case T_Group:
@@ -2798,9 +2799,6 @@ ExplainNode(PlanState *planstate, List *ancestors,
planstate, es);
break;
#endif
- case T_WindowAgg:
- show_windowagg_keys((WindowAggState *) planstate,
ancestors, es);
- break;
case T_TableFunctionScan:
show_scan_qual(plan->qual, "Filter", planstate,
ancestors, es);
/* TODO: Partitioning and ordering information */
diff --git a/src/backend/commands/functioncmds.c
b/src/backend/commands/functioncmds.c
index 4e1a542f6be..4fd368c4f2d 100644
--- a/src/backend/commands/functioncmds.c
+++ b/src/backend/commands/functioncmds.c
@@ -668,6 +668,13 @@ compute_common_attribute(ParseState *pstate,
/* Recognized an option */
return true;
+duplicate_error:
+ ereport(ERROR,
+ (errcode(ERRCODE_SYNTAX_ERROR),
+ errmsg("conflicting or redundant options"),
+ parser_errposition(pstate,
defel->location)));
+ return false; /* keep compiler quiet */
+
procedure_error:
ereport(ERROR,
(errcode(ERRCODE_INVALID_FUNCTION_DEFINITION),
@@ -1341,7 +1348,7 @@ validate_describe_callback(List *describeQualName,
errmsg("describe function cannot be
variadic")));
/* Check that the creator has permission to call the function */
- aclresult = pg_proc_aclcheck(describeFuncOid, GetUserId(), ACL_EXECUTE);
+ aclresult = object_aclcheck(ProcedureRelationId, describeFuncOid,
GetUserId(), ACL_EXECUTE);
if (aclresult != ACLCHECK_OK)
aclcheck_error(aclresult, OBJECT_PROCEDURE,
get_func_name(describeFuncOid));
@@ -1879,7 +1886,6 @@ AlterFunction(ParseState *pstate, AlterFunctionStmt *stmt)
if (set_items)
{
Datum datum;
- bool isnull;
ArrayType *a;
Datum repl_val[Natts_pg_proc];
bool repl_null[Natts_pg_proc];
@@ -2661,7 +2667,7 @@ ExecuteDoStmt(ParseState *pstate, DoStmt *stmt, bool
atomic)
static void
CheckForModifySystemFunc(Oid funcOid, List *funcName)
{
- if (!allowSystemTableMods && funcOid < FirstBootstrapObjectId)
+ if (!allowSystemTableMods && funcOid < FirstUnpinnedObjectId)
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
errmsg("permission defined: \"%s\" is a system
function",
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index bbcbb2b2da3..3666f97a895 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -751,11 +751,9 @@ DefineIndex(Oid relationId,
LockRelId heaprelid;
LOCKTAG heaplocktag;
LOCKMODE lockmode;
- Snapshot snapshot;
Oid root_save_userid;
int root_save_sec_context;
int root_save_nestlevel;
- int i;
bool shouldDispatch;
Oid blkdirrelid = InvalidOid;
@@ -1874,7 +1872,6 @@ DefineIndex(Oid relationId,
IndexStmt *childStmt =
copyObject(stmt);
bool found_whole_row;
ListCell *lc;
- ObjectAddress childAddr;
/*
* We can't use the same index name for
the child index,
@@ -1980,7 +1977,7 @@ DefineIndex(Oid relationId,
if (shouldDispatch)
{
/* make sure the QE uses the same index name that we
chose */
- stmt->oldNode = InvalidOid;
+ stmt->oldNumber = InvalidOid;
Assert(stmt->relation != NULL);
stmt->tableSpace = get_tablespace_name(tablespaceId);
@@ -2019,7 +2016,7 @@ DefineIndex(Oid relationId,
if (!concurrent)
flags |= DF_NEED_TWO_PHASE;
/* make sure the QE uses the same index name that we chose */
- stmt->oldNode = InvalidOid;
+ stmt->oldNumber = InvalidOid;
Assert(stmt->relation != NULL);
CdbDispatchUtilityStatement((Node *) stmt, flags,
GetAssignedOidsForDispatch(),
diff --git a/src/backend/commands/matview.c b/src/backend/commands/matview.c
index d2514e326bc..de5b6992b6d 100644
--- a/src/backend/commands/matview.c
+++ b/src/backend/commands/matview.c
@@ -1855,7 +1855,7 @@ ivm_immediate_maintenance(PG_FUNCTION_ARGS)
if (!(query->hasAggs && query->groupClause == NIL))
ExecuteTruncateGuts(list_make1(matviewRel),
list_make1_oid(matviewOid),
- NIL, DROP_RESTRICT,
false, NULL);
+ NIL, DROP_RESTRICT,
false, false, NULL);
else if (Gp_role == GP_ROLE_DISPATCH)
ExecuteTruncateGuts_IVM(matviewRel, matviewOid, query);
diff --git a/src/backend/commands/prepare.c b/src/backend/commands/prepare.c
index 871b84bf37b..aa75e17a764 100644
--- a/src/backend/commands/prepare.c
+++ b/src/backend/commands/prepare.c
@@ -65,7 +65,6 @@ PrepareQuery(ParseState *pstate, PrepareStmt *stmt,
int nargs;
Query *query;
List *query_list;
- int i;
NodeTag srctag; /* GPDB */
/*
@@ -120,12 +119,12 @@ PrepareQuery(ParseState *pstate, PrepareStmt *stmt,
* Rewrite the query. The result could be 0, 1, or many queries.
*/
query = parse_analyze_varparams(rawstmt, pstate->p_sourcetext,
-
&argtypes, &nargs);
+
&argtypes, &nargs, NULL);
/*
* Check that all parameter types were determined.
*/
- for (i = 0; i < nargs; i++)
+ for (int i = 0; i < nargs; i++)
{
Oid argtype = argtypes[i];
diff --git a/src/backend/commands/publicationcmds.c
b/src/backend/commands/publicationcmds.c
index 5de6728476d..c913171cafd 100644
--- a/src/backend/commands/publicationcmds.c
+++ b/src/backend/commands/publicationcmds.c
@@ -865,11 +865,7 @@ CreatePublication(ParseState *pstate,
CreatePublicationStmt *stmt)
PublicationAddSchemas(puboid, schemaidlist, true, NULL);
}
}
- else if (stmt->for_all_tables)
- {
- /* Invalidate relcache so that publication info is rebuilt. */
- CacheInvalidateRelcacheAll();
- }
+
table_close(rel, RowExclusiveLock);
@@ -1557,35 +1553,6 @@ RemovePublicationById(Oid pubid)
table_close(rel, RowExclusiveLock);
}
-/*
- * Remove the publication by mapping OID.
- */
-void
-RemovePublicationById(Oid pubid)
-{
- Relation rel;
- HeapTuple tup;
- Form_pg_publication pubform;
-
- rel = table_open(PublicationRelationId, RowExclusiveLock);
-
- tup = SearchSysCache1(PUBLICATIONOID, ObjectIdGetDatum(pubid));
- if (!HeapTupleIsValid(tup))
- elog(ERROR, "cache lookup failed for publication %u", pubid);
-
- pubform = (Form_pg_publication) GETSTRUCT(tup);
-
- /* Invalidate relcache so that publication info is rebuilt. */
- if (pubform->puballtables)
- CacheInvalidateRelcacheAll();
-
- CatalogTupleDelete(rel, &tup->t_self);
-
- ReleaseSysCache(tup);
-
- table_close(rel, RowExclusiveLock);
-}
-
/*
* Remove schema from publication by mapping OID.
*/
diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c
index 6876e1c8dfe..c57880e3956 100644
--- a/src/backend/commands/sequence.c
+++ b/src/backend/commands/sequence.c
@@ -101,7 +101,7 @@ SeqTableKey;
*/
typedef struct SeqTableData
{
- SeqTableKey key; /* sequence data hash key *//
+ SeqTableKey key; /* sequence data hash key */
RelFileNumber filenumber; /* last seen relfilenumber of this
sequence */
LocalTransactionId lxid; /* xact in which we last did a seq op */
bool last_valid; /* do we have a valid "last"
value? */
@@ -425,9 +425,9 @@ fill_seq_with_data(Relation rel, HeapTuple tuple)
{
SMgrRelation srel;
- srel = smgropen(rel->rd_locator, InvalidBackendId);
+ srel = smgropen(rel->rd_locator, InvalidBackendId, SMGR_MD,
rel);
smgrcreate(srel, INIT_FORKNUM, false);
- log_smgrcreate(&rel->rd_locator, INIT_FORKNUM);
+ log_smgrcreate(&rel->rd_locator, INIT_FORKNUM, SMGR_MD);
fill_seq_fork_with_data(rel, tuple, INIT_FORKNUM);
FlushRelationBuffers(rel);
smgrclose(srel);
@@ -2135,7 +2135,7 @@ cdb_sequence_nextval_qe(Relation seqrel,
char *current;
int *pint32;
StringInfoData buf;
- Oid dbid = seqrel->rd_node.dbNode;
+ Oid dbid = seqrel->rd_locator.dbOid;
Oid seq_oid = seqrel->rd_id;
/*
diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h
index 5dbb522a1d0..5149e52cf47 100644
--- a/src/include/nodes/nodes.h
+++ b/src/include/nodes/nodes.h
@@ -514,6 +514,7 @@ typedef enum NodeTag
T_AlterEnumStmt,
T_AlterTSDictionaryStmt,
T_AlterTSConfigurationStmt,
+ T_PublicationTable,
T_CreateFdwStmt,
T_AlterFdwStmt,
T_CreateForeignServerStmt,
diff --git a/src/include/portability/instr_time.h
b/src/include/portability/instr_time.h
index 1f6e51ae75e..9ce71ab2d0f 100644
--- a/src/include/portability/instr_time.h
+++ b/src/include/portability/instr_time.h
@@ -125,7 +125,7 @@ pg_clock_gettime_ns(void)
#define INSTR_TIME_SET_CURRENT_COARSE(t) INSTR_TIME_SET_CURRENT(t)
-#define INSTR_TIME_ASSIGN(x,y) ((x).tv_sec = (y).tv_sec, (x).tv_nsec =
(y).tv_nsec)
+#define INSTR_TIME_ASSIGN(x,y) ((x).ticks = (y).ticks)
#define INSTR_TIME_GET_NANOSEC(t) \
((int64) (t).ticks)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]