You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudberry.apache.org by ch...@apache.org on 2025/07/24 01:49:58 UTC

(cloudberry) branch cbdb-postgres-merge updated: Fix conflicts in c files for parser

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 e0ab09cbe92 Fix conflicts in c files for parser
e0ab09cbe92 is described below

commit e0ab09cbe928d317b0f03712f16d4047100f60b4
Author: Jinbao Chen <ch...@gmail.com>
AuthorDate: Thu Jul 24 09:49:46 2025 +0800

    Fix conflicts in c files for parser
---
 src/backend/parser/analyze.c        | 39 ++-------------------
 src/backend/parser/parse_clause.c   | 13 -------
 src/backend/parser/parse_collate.c  |  3 --
 src/backend/parser/parse_cte.c      | 70 +------------------------------------
 src/backend/parser/parse_relation.c | 21 -----------
 src/backend/parser/parse_type.c     |  4 ---
 src/backend/parser/parse_utilcmd.c  | 44 -----------------------
 7 files changed, 3 insertions(+), 191 deletions(-)

diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c
index a3bec2033cd..7fdfe7d4cce 100644
--- a/src/backend/parser/analyze.c
+++ b/src/backend/parser/analyze.c
@@ -14,13 +14,9 @@
  * contain optimizable statements, which we should transform.
  *
  *
-<<<<<<< HEAD
  * Portions Copyright (c) 2005-2010, Greenplum inc
  * Portions Copyright (c) 2012-Present VMware, Inc. or its affiliates.
- * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
-=======
  * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
->>>>>>> REL_16_9
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  *	src/backend/parser/analyze.c
@@ -2486,13 +2482,8 @@ transformSetOperationTree_internal(ParseState *pstate, SelectStmt *stmt,
 		/* Process an internal node (set operation node) */
 		SetOperationStmt *op = makeNode(SetOperationStmt);
 		const char *context;
-<<<<<<< HEAD
-		bool recursive = (pstate->p_parent_cte &&
-						  pstate->p_parent_cte->cterecursive);
-=======
 		bool		recursive = (pstate->p_parent_cte &&
 								 pstate->p_parent_cte->cterecursive);
->>>>>>> REL_16_9
 
 		context = (stmt->op == SETOP_UNION ? "UNION" :
 				   (stmt->op == SETOP_INTERSECT ? "INTERSECT" :
@@ -2527,7 +2518,6 @@ transformSetOperationTree_internal(ParseState *pstate, SelectStmt *stmt,
 		 * branch.
 		 */
 		if (isTopLevel && recursive)
-<<<<<<< HEAD
 		{
 			List *ltargetlist;
 			List *selected_types;
@@ -2537,8 +2527,6 @@ transformSetOperationTree_internal(ParseState *pstate, SelectStmt *stmt,
 
 			coerceSetOpTypes(pstate, op->larg, selected_types, selected_typmods, &ltargetlist);
 
-=======
->>>>>>> REL_16_9
 			determineRecursiveColTypes(pstate, op->larg, ltargetlist);
 		}
 
@@ -2770,14 +2758,10 @@ coerceSetOpTypes(ParseState *pstate, Node *sop,
 				setup_parser_errposition_callback(&pcbstate, pstate,
 												  bestlocation);
 
-<<<<<<< HEAD
-				/* If it's a recursive union, we need to require hashing support. */
-=======
 				/*
 				 * If it's a recursive union, we need to require hashing
 				 * support.
 				 */
->>>>>>> REL_16_9
 				op->groupClauses = lappend(op->groupClauses,
 										   makeSortGroupClauseForSetOp(rescoltype, recursive));
 
@@ -3859,16 +3843,12 @@ transformLockingClause(ParseState *pstate, Query *qry, LockingClause *lc,
 			switch (rte->rtekind)
 			{
 				case RTE_RELATION:
-<<<<<<< HEAD
 					if (rel_is_external_table(rte->relid))
 						ereport(ERROR,
 								(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
 								 errmsg("SELECT FOR UPDATE/SHARE cannot be applied to external tables")));
 
-					applyLockingClause(qry, i, lc->strength, lc->waitPolicy,
-									   pushedDown);
-					rte->requiredPerms |= ACL_SELECT_FOR_UPDATE;
-=======
+
 					{
 						RTEPermissionInfo *perminfo;
 
@@ -3879,7 +3859,6 @@ transformLockingClause(ParseState *pstate, Query *qry, LockingClause *lc,
 						perminfo = getRTEPermissionInfo(qry->rteperminfos, rte);
 						perminfo->requiredPerms |= ACL_SELECT_FOR_UPDATE;
 					}
->>>>>>> REL_16_9
 					break;
 				case RTE_SUBQUERY:
 					applyLockingClause(qry, i, lc->strength, lc->waitPolicy,
@@ -3935,14 +3914,7 @@ transformLockingClause(ParseState *pstate, Query *qry, LockingClause *lc,
 				/*
 				 * A join RTE without an alias is not visible as a relation
 				 * name and needs to be skipped (otherwise it might hide a
-<<<<<<< HEAD
-				 * base relation with the same name).
-				 */
-				if (rte->rtekind == RTE_JOIN && rte->alias == NULL)
-					continue;
-
-				if (strcmp(rte->eref->aliasname, thisrel->relname) == 0)
-=======
+				/*
 				 * base relation with the same name), except if it has a USING
 				 * alias, which *is* visible.
 				 *
@@ -3963,20 +3935,14 @@ transformLockingClause(ParseState *pstate, Query *qry, LockingClause *lc,
 				}
 
 				if (strcmp(rtename, thisrel->relname) == 0)
->>>>>>> REL_16_9
 				{
 					switch (rte->rtekind)
 					{
 						case RTE_RELATION:
-<<<<<<< HEAD
 							if (rel_is_external_table(rte->relid))
 								ereport(ERROR,
 										(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
 										 errmsg("SELECT FOR UPDATE/SHARE cannot be applied to external tables")));
-							applyLockingClause(qry, i, lc->strength,
-											   lc->waitPolicy, pushedDown);
-							rte->requiredPerms |= ACL_SELECT_FOR_UPDATE;
-=======
 							{
 								RTEPermissionInfo *perminfo;
 
@@ -3987,7 +3953,6 @@ transformLockingClause(ParseState *pstate, Query *qry, LockingClause *lc,
 								perminfo = getRTEPermissionInfo(qry->rteperminfos, rte);
 								perminfo->requiredPerms |= ACL_SELECT_FOR_UPDATE;
 							}
->>>>>>> REL_16_9
 							break;
 						case RTE_SUBQUERY:
 							applyLockingClause(qry, i, lc->strength,
diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c
index a62632976e9..b04f8257769 100644
--- a/src/backend/parser/parse_clause.c
+++ b/src/backend/parser/parse_clause.c
@@ -3,13 +3,9 @@
  * parse_clause.c
  *	  handle clauses in parser
  *
-<<<<<<< HEAD
  * Portions Copyright (c) 2006-2008, Greenplum inc
  * Portions Copyright (c) 2012-Present VMware, Inc. or its affiliates.
- * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
-=======
  * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
->>>>>>> REL_16_9
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  *
@@ -582,13 +578,7 @@ transformRangeSubselect(ParseState *pstate, RangeSubselect *r)
 	 * might still be required (if there is an all-tables locking clause).
 	 */
 	query = parse_sub_analyze(r->subquery, pstate, NULL,
-<<<<<<< HEAD
 							  getLockedRefname(pstate, r->alias->aliasname),
-=======
-							  isLockedRefname(pstate,
-											  r->alias == NULL ? NULL :
-											  r->alias->aliasname),
->>>>>>> REL_16_9
 							  true);
 
 	/* Restore state */
@@ -1744,8 +1734,6 @@ transformFromClauseItem(ParseState *pstate, Node *n,
 									&res_colnames, &res_colvars,
 									res_nscolumns + res_colindex);
 
-<<<<<<< HEAD
-=======
 		/* If join has an alias, it syntactically hides all inputs */
 		if (j->alias)
 		{
@@ -1758,7 +1746,6 @@ transformFromClauseItem(ParseState *pstate, Node *n,
 			}
 		}
 
->>>>>>> REL_16_9
 		/*
 		 * Now build an RTE and nsitem for the result of the join.
 		 */
diff --git a/src/backend/parser/parse_collate.c b/src/backend/parser/parse_collate.c
index bd296d0e0e8..d52bbffd1f3 100644
--- a/src/backend/parser/parse_collate.c
+++ b/src/backend/parser/parse_collate.c
@@ -488,11 +488,8 @@ assign_collations_walker(Node *node, assign_collations_context *context)
 		case T_FromExpr:
 		case T_OnConflictExpr:
 		case T_SortGroupClause:
-<<<<<<< HEAD
 		case T_WindowClause:
-=======
 		case T_MergeAction:
->>>>>>> REL_16_9
 			(void) expression_tree_walker(node,
 										  assign_collations_walker,
 										  (void *) &loccontext);
diff --git a/src/backend/parser/parse_cte.c b/src/backend/parser/parse_cte.c
index 45cb286ad87..e3ea88a273b 100644
--- a/src/backend/parser/parse_cte.c
+++ b/src/backend/parser/parse_cte.c
@@ -281,75 +281,7 @@ analyzeCTE(ParseState *pstate, CommonTableExpr *cte)
 	/* Analysis not done already */
 	Assert(!IsA(cte->ctequery, Query));
 
-<<<<<<< HEAD
-	query = parse_sub_analyze(cte->ctequery, pstate, cte, NULL, true);
-=======
-	/*
-	 * Before analyzing the CTE's query, we'd better identify the data type of
-	 * the cycle mark column if any, since the query could refer to that.
-	 * Other validity checks on the cycle clause will be done afterwards.
-	 */
-	if (cycle_clause)
-	{
-		TypeCacheEntry *typentry;
-		Oid			op;
-
-		cycle_clause->cycle_mark_value =
-			transformExpr(pstate, cycle_clause->cycle_mark_value,
-						  EXPR_KIND_CYCLE_MARK);
-		cycle_clause->cycle_mark_default =
-			transformExpr(pstate, cycle_clause->cycle_mark_default,
-						  EXPR_KIND_CYCLE_MARK);
-
-		cycle_clause->cycle_mark_type =
-			select_common_type(pstate,
-							   list_make2(cycle_clause->cycle_mark_value,
-										  cycle_clause->cycle_mark_default),
-							   "CYCLE", NULL);
-		cycle_clause->cycle_mark_value =
-			coerce_to_common_type(pstate,
-								  cycle_clause->cycle_mark_value,
-								  cycle_clause->cycle_mark_type,
-								  "CYCLE/SET/TO");
-		cycle_clause->cycle_mark_default =
-			coerce_to_common_type(pstate,
-								  cycle_clause->cycle_mark_default,
-								  cycle_clause->cycle_mark_type,
-								  "CYCLE/SET/DEFAULT");
-
-		cycle_clause->cycle_mark_typmod =
-			select_common_typmod(pstate,
-								 list_make2(cycle_clause->cycle_mark_value,
-											cycle_clause->cycle_mark_default),
-								 cycle_clause->cycle_mark_type);
-
-		cycle_clause->cycle_mark_collation =
-			select_common_collation(pstate,
-									list_make2(cycle_clause->cycle_mark_value,
-											   cycle_clause->cycle_mark_default),
-									true);
-
-		/* Might as well look up the relevant <> operator while we are at it */
-		typentry = lookup_type_cache(cycle_clause->cycle_mark_type,
-									 TYPECACHE_EQ_OPR);
-		if (!OidIsValid(typentry->eq_opr))
-			ereport(ERROR,
-					errcode(ERRCODE_UNDEFINED_FUNCTION),
-					errmsg("could not identify an equality operator for type %s",
-						   format_type_be(cycle_clause->cycle_mark_type)));
-		op = get_negator(typentry->eq_opr);
-		if (!OidIsValid(op))
-			ereport(ERROR,
-					errcode(ERRCODE_UNDEFINED_FUNCTION),
-					errmsg("could not identify an inequality operator for type %s",
-						   format_type_be(cycle_clause->cycle_mark_type)));
-
-		cycle_clause->cycle_mark_neop = op;
-	}
-
-	/* Now we can get on with analyzing the CTE's query */
-	query = parse_sub_analyze(cte->ctequery, pstate, cte, false, true);
->>>>>>> REL_16_9
+、	query = parse_sub_analyze(cte->ctequery, pstate, cte, NULL, true);
 	cte->ctequery = (Node *) query;
 
 	/*
diff --git a/src/backend/parser/parse_relation.c b/src/backend/parser/parse_relation.c
index de1e6304906..950ebe5ae7e 100644
--- a/src/backend/parser/parse_relation.c
+++ b/src/backend/parser/parse_relation.c
@@ -3,13 +3,9 @@
  * parse_relation.c
  *	  parser support routines dealing with relations
  *
-<<<<<<< HEAD
  * Portions Copyright (c) 2006-2008, Greenplum inc
  * Portions Copyright (c) 2012-Present VMware, Inc. or its affiliates.
- * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
-=======
  * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
->>>>>>> REL_16_9
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  *
@@ -1788,22 +1784,12 @@ addRangeTableEntryForSubquery(ParseState *pstate,
 	rte->inh = false;			/* never true for subqueries */
 	rte->inFromCl = inFromCl;
 
-<<<<<<< HEAD
-	rte->requiredPerms = 0;
-	rte->checkAsUser = InvalidOid;
-	rte->selectedCols = NULL;
-	rte->insertedCols = NULL;
-	rte->updatedCols = NULL;
-	rte->extraUpdatedCols = NULL;
-
 	Assert(pstate != NULL);
-=======
 	/*
 	 * Add completed RTE to pstate's range table list, so that we know its
 	 * index.  But we don't add it to the join list --- caller must do that if
 	 * appropriate.
 	 */
->>>>>>> REL_16_9
 	pstate->p_rtable = lappend(pstate->p_rtable, rte);
 
 	/*
@@ -2289,11 +2275,8 @@ addRangeTableEntryForTableFunc(ParseState *pstate,
 	Assert(list_length(tf->coltypmods) == list_length(tf->colnames));
 	Assert(list_length(tf->colcollations) == list_length(tf->colnames));
 
-<<<<<<< HEAD
-=======
 	refname = alias ? alias->aliasname : pstrdup("xmltable");
 
->>>>>>> REL_16_9
 	rte->rtekind = RTE_TABLEFUNC;
 	rte->relid = InvalidOid;
 	rte->subquery = NULL;
@@ -2315,12 +2298,8 @@ addRangeTableEntryForTableFunc(ParseState *pstate,
 		ereport(ERROR,
 				(errcode(ERRCODE_INVALID_COLUMN_REFERENCE),
 				 errmsg("%s function has %d columns available but %d columns specified",
-<<<<<<< HEAD
-						"XMLTABLE", list_length(tf->colnames), numaliases)));
-=======
 						"XMLTABLE",
 						list_length(tf->colnames), numaliases)));
->>>>>>> REL_16_9
 
 	rte->eref = eref;
 
diff --git a/src/backend/parser/parse_type.c b/src/backend/parser/parse_type.c
index b7d9bb7564d..9ff8db720f7 100644
--- a/src/backend/parser/parse_type.c
+++ b/src/backend/parser/parse_type.c
@@ -3,13 +3,9 @@
  * parse_type.c
  *		handle type operations for parser
  *
-<<<<<<< HEAD
  * Portions Copyright (c) 2006-2008, Greenplum inc
  * Portions Copyright (c) 2012-Present VMware, Inc. or its affiliates.
- * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
-=======
  * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
->>>>>>> REL_16_9
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  *
diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c
index f1003ad44d7..a9088ce68b5 100644
--- a/src/backend/parser/parse_utilcmd.c
+++ b/src/backend/parser/parse_utilcmd.c
@@ -154,12 +154,6 @@ static void transformPartitionCmd(CreateStmtContext *cxt, PartitionCmd *cmd);
 static List *transformPartitionRangeBounds(ParseState *pstate, List *blist,
 										   Relation parent, PartitionKey key);
 static void validateInfiniteBounds(ParseState *pstate, List *blist);
-<<<<<<< HEAD
-=======
-static Const *transformPartitionBoundValue(ParseState *pstate, Node *val,
-										   const char *colName, Oid colType, int32 colTypmod,
-										   Oid partCollation);
->>>>>>> REL_16_9
 
 static DistributedBy *getLikeDistributionPolicy(TableLikeClause *e);
 static DistributedBy *transformDistributedBy(ParseState *pstate,
@@ -296,11 +290,7 @@ transformCreateStmt(CreateStmt *stmt, const char *queryString)
 	cxt.fkconstraints = NIL;
 	cxt.ixconstraints = NIL;
 	cxt.likeclauses = NIL;
-<<<<<<< HEAD
-	cxt.extstats = NIL;
 	cxt.attr_encodings = stmt->attr_encodings;
-=======
->>>>>>> REL_16_9
 	cxt.blist = NIL;
 	cxt.alist = NIL;
 	cxt.pkey = NULL;
@@ -476,15 +466,8 @@ generateSerialExtraStmts(CreateStmtContext *cxt, ColumnDef *column,
 	AlterSeqStmt *altseqstmt;
 	List	   *attnamelist;
 
-<<<<<<< HEAD
 	bool		has_cache_option = false;
 
-	int			nameEl_idx = -1;
-=======
-	/* Make a copy of this as we may end up modifying it in the code below */
-	seqoptions = list_copy(seqoptions);
->>>>>>> REL_16_9
-
 	/*
 	 * Check for non-SQL-standard options (not supported within CREATE
 	 * SEQUENCE, because they'd be redundant), and remove them from the
@@ -1148,14 +1131,9 @@ transformTableLikeClause(CreateStmtContext *cxt, TableLikeClause *table_like_cla
 		relation->rd_rel->relkind != RELKIND_PARTITIONED_TABLE)
 		ereport(ERROR,
 				(errcode(ERRCODE_WRONG_OBJECT_TYPE),
-<<<<<<< HEAD
-				 errmsg("\"%s\" is not a table, directory table, view, materialized view, composite type, or foreign table",
-						RelationGetRelationName(relation))));
-=======
 				 errmsg("relation \"%s\" is invalid in LIKE clause",
 						RelationGetRelationName(relation)),
 				 errdetail_relkind_not_supported(relation->rd_rel->relkind)));
->>>>>>> REL_16_9
 
 	cancel_parser_errposition_callback(&pcbstate);
 
@@ -1310,7 +1288,6 @@ transformTableLikeClause(CreateStmtContext *cxt, TableLikeClause *table_like_cla
 	}
 
 	/*
-<<<<<<< HEAD
 	 * GPDB_12_MERGE_FIXME:
 	 * 		This is wrong and creates unspecified behaviour when multiple like
 	 * 		clauses are present in the statement.
@@ -1400,8 +1377,6 @@ transformTableLikeClause(CreateStmtContext *cxt, TableLikeClause *table_like_cla
 	}
 
 	/*
-=======
->>>>>>> REL_16_9
 	 * Close the parent rel, but keep our AccessShareLock on it until xact
 	 * commit.  That will prevent someone else from deleting or ALTERing the
 	 * parent before we can run expandTableLikeClause.
@@ -2216,23 +2191,8 @@ generateClonedExtStatsStmt(RangeVar *heapRel, Oid heapRelid,
 		{
 			Node	   *expr = (Node *) lfirst(lc);
 			StatsElem  *selem = makeNode(StatsElem);
-<<<<<<< HEAD
 			selem->name = NULL;
 			selem->expr = (Node *) lfirst(lc);
-=======
-			bool		found_whole_row;
-
-			/* Adjust Vars to match new table's column numbering */
-			expr = map_variable_attnos(expr,
-									   1, 0,
-									   attmap,
-									   InvalidOid,
-									   &found_whole_row);
-
-			selem->name = NULL;
-			selem->expr = expr;
-
->>>>>>> REL_16_9
 			def_names = lappend(def_names, selem);
 		}
 		pfree(exprsString);
@@ -4893,12 +4853,8 @@ transformAlterTableStmt(Oid relid, AlterTableStmt *stmt,
 		newcmds = lappend(newcmds, newcmd);
 	}
 
-<<<<<<< HEAD
 	/* Append extended statistics objects */
 	transformExtendedStatistics(&cxt);
-
-=======
->>>>>>> REL_16_9
 	/* Close rel */
 	relation_close(rel, NoLock);
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cloudberry.apache.org
For additional commands, e-mail: commits-help@cloudberry.apache.org