=== Applying patches on top of PostgreSQL commit ID aa082bed0b6433b58815683dde425bce57ed931c === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Fri Feb 13 12:56:23 UTC 2026 On branch cf/6378 nothing to commit, working tree clean === using 'git am' to apply patch ./qualify_v1.patch === Patch format detection failed. === using patch(1) to apply patch ./qualify_v1.patch === patching file src/backend/optimizer/plan/planner.c Hunk #2 succeeded at 1902 (offset 51 lines). Hunk #3 succeeded at 4611 (offset 53 lines). Hunk #4 succeeded at 4657 (offset 53 lines). Hunk #5 succeeded at 4700 (offset 53 lines). patching file src/backend/parser/analyze.c Hunk #1 succeeded at 1408 (offset 10 lines). Hunk #2 succeeded at 2037 (offset 10 lines). patching file src/backend/parser/gram.y Hunk #1 succeeded at 319 (offset 1 line). Hunk #2 succeeded at 771 (offset 3 lines). Hunk #3 succeeded at 13121 (offset 70 lines). Hunk #4 succeeded at 13134 (offset 70 lines). Hunk #5 succeeded at 13154 (offset 70 lines). Hunk #6 succeeded at 14282 (offset 75 lines). Hunk #7 succeeded at 14304 (offset 75 lines). Hunk #8 succeeded at 18437 (offset 77 lines). patching file src/backend/parser/parse_agg.c patching file src/backend/parser/parse_clause.c patching file src/backend/parser/parse_expr.c Hunk #1 succeeded at 543 (offset 1 line). Hunk #2 succeeded at 849 (offset 1 line). Hunk #3 succeeded at 1839 (offset 10 lines). Hunk #4 succeeded at 3196 (offset 10 lines). patching file src/backend/parser/parse_func.c patching file src/include/nodes/parsenodes.h Hunk #1 FAILED at 116. Hunk #3 succeeded at 1253 (offset 27 lines). Hunk #4 succeeded at 1599 (offset 28 lines). Hunk #5 succeeded at 2220 (offset 29 lines). 1 out of 5 hunks FAILED -- saving rejects to file src/include/nodes/parsenodes.h.rej patching file src/include/parser/kwlist.h Hunk #1 succeeded at 362 (offset 1 line). patching file src/include/parser/parse_clause.h patching file src/include/parser/parse_node.h Hunk #2 succeeded at 227 (offset -5 lines). patching file src/test/regress/expected/qualify.out patching file src/test/regress/parallel_schedule patching file src/test/regress/sql/qualify.sql Unstaged changes after reset: M src/backend/optimizer/plan/planner.c M src/backend/parser/analyze.c M src/backend/parser/gram.y M src/backend/parser/parse_agg.c M src/backend/parser/parse_clause.c M src/backend/parser/parse_expr.c M src/backend/parser/parse_func.c M src/include/nodes/parsenodes.h M src/include/parser/kwlist.h M src/include/parser/parse_clause.h M src/include/parser/parse_node.h M src/test/regress/parallel_schedule Removing src/include/nodes/parsenodes.h.rej Removing src/test/regress/expected/qualify.out Removing src/test/regress/sql/qualify.sql === using 'git apply' to apply patch ./qualify_v1.patch === /work/patches/./qualify_v1.patch:85: indent with spaces. SelectStmtPassthrough *passthru) /work/patches/./qualify_v1.patch:228: indent with spaces. Query *qry = makeNode(Query); /work/patches/./qualify_v1.patch:229: indent with spaces. Node *qual; /work/patches/./qualify_v1.patch:230: indent with spaces. ListCell *l; /work/patches/./qualify_v1.patch:232: indent with spaces. qry->commandType = CMD_SELECT; Applied patch to 'src/backend/optimizer/plan/planner.c' cleanly. Applied patch to 'src/backend/parser/analyze.c' cleanly. Applied patch to 'src/backend/parser/gram.y' cleanly. Applied patch to 'src/backend/parser/parse_agg.c' cleanly. Applied patch to 'src/backend/parser/parse_clause.c' cleanly. Applied patch to 'src/backend/parser/parse_expr.c' cleanly. Applied patch to 'src/backend/parser/parse_func.c' cleanly. Applied patch to 'src/include/nodes/parsenodes.h' with conflicts. Applied patch to 'src/include/parser/kwlist.h' cleanly. Applied patch to 'src/include/parser/parse_clause.h' cleanly. Applied patch to 'src/include/parser/parse_node.h' cleanly. Falling back to direct application... Applied patch to 'src/test/regress/parallel_schedule' cleanly. Falling back to direct application... U src/include/nodes/parsenodes.h warning: squelched 495 whitespace errors warning: 500 lines add whitespace errors. diff --cc src/include/nodes/parsenodes.h index 0aec49bdd22,2b5b1a77a4d..00000000000 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@@ -116,145 -116,148 +116,290 @@@ typedef uint64 AclMode; /* a bitmask */ typedef struct Query { ++<<<<<<< ours + NodeTag type; + + CmdType commandType; /* select|insert|update|delete|merge|utility */ + + /* where did I come from? */ + QuerySource querySource pg_node_attr(query_jumble_ignore); + + /* + * query identifier (can be set by plugins); ignored for equal, as it + * might not be set; also not stored. This is the result of the query + * jumble, hence ignored. + * + * We store this as a signed value as this is the form it's displayed to + * users in places such as EXPLAIN and pg_stat_statements. Primarily this + * is done due to lack of an SQL type to represent the full range of + * uint64. + */ + int64 queryId pg_node_attr(equal_ignore, query_jumble_ignore, read_write_ignore, read_as(0)); + + /* do I set the command result tag? */ + bool canSetTag pg_node_attr(query_jumble_ignore); + + Node *utilityStmt; /* non-null if commandType == CMD_UTILITY */ + + /* + * rtable index of target relation for INSERT/UPDATE/DELETE/MERGE; 0 for + * SELECT. This is ignored in the query jumble as unrelated to the + * compilation of the query ID. + */ + int resultRelation pg_node_attr(query_jumble_ignore); + + /* has aggregates in tlist or havingQual */ + bool hasAggs pg_node_attr(query_jumble_ignore); + /* has window functions in tlist */ + bool hasWindowFuncs pg_node_attr(query_jumble_ignore); + /* has set-returning functions in tlist */ + bool hasTargetSRFs pg_node_attr(query_jumble_ignore); + /* has subquery SubLink */ + bool hasSubLinks pg_node_attr(query_jumble_ignore); + /* distinctClause is from DISTINCT ON */ + bool hasDistinctOn pg_node_attr(query_jumble_ignore); + /* WITH RECURSIVE was specified */ + bool hasRecursive pg_node_attr(query_jumble_ignore); + /* has INSERT/UPDATE/DELETE/MERGE in WITH */ + bool hasModifyingCTE pg_node_attr(query_jumble_ignore); + /* FOR [KEY] UPDATE/SHARE was specified */ + bool hasForUpdate pg_node_attr(query_jumble_ignore); + /* rewriter has applied some RLS policy */ + bool hasRowSecurity pg_node_attr(query_jumble_ignore); + /* parser has added an RTE_GROUP RTE */ + bool hasGroupRTE pg_node_attr(query_jumble_ignore); + /* is a RETURN statement */ + bool isReturn pg_node_attr(query_jumble_ignore); + + List *cteList; /* WITH list (of CommonTableExpr's) */ + + List *rtable; /* list of range table entries */ + + /* + * list of RTEPermissionInfo nodes for the rtable entries having + * perminfoindex > 0 + */ + List *rteperminfos pg_node_attr(query_jumble_ignore); + FromExpr *jointree; /* table join tree (FROM and WHERE clauses); + * also USING clause for MERGE */ + + List *mergeActionList; /* list of actions for MERGE (only) */ + + /* + * rtable index of target relation for MERGE to pull data. Initially, this + * is the same as resultRelation, but after query rewriting, if the target + * relation is a trigger-updatable view, this is the index of the expanded + * view subquery, whereas resultRelation is the index of the target view. + */ + int mergeTargetRelation pg_node_attr(query_jumble_ignore); + + /* join condition between source and target for MERGE */ + Node *mergeJoinCondition; + + List *targetList; /* target list (of TargetEntry) */ + + /* OVERRIDING clause */ + OverridingKind override pg_node_attr(query_jumble_ignore); + + OnConflictExpr *onConflict; /* ON CONFLICT DO NOTHING/SELECT/UPDATE */ + + /* + * The following three fields describe the contents of the RETURNING list + * for INSERT/UPDATE/DELETE/MERGE. returningOldAlias and returningNewAlias + * are the alias names for OLD and NEW, which may be user-supplied values, + * the defaults "old" and "new", or NULL (if the default "old"/"new" is + * already in use as the alias for some other relation). + */ + char *returningOldAlias pg_node_attr(query_jumble_ignore); + char *returningNewAlias pg_node_attr(query_jumble_ignore); + List *returningList; /* return-values list (of TargetEntry) */ + + List *groupClause; /* a list of SortGroupClause's */ + bool groupDistinct; /* was GROUP BY DISTINCT used? */ + bool groupByAll; /* was GROUP BY ALL used? */ + + List *groupingSets; /* a list of GroupingSet's if present */ + + Node *havingQual; /* qualifications applied to groups */ + + List *windowClause; /* a list of WindowClause's */ + + List *distinctClause; /* a list of SortGroupClause's */ + + List *sortClause; /* a list of SortGroupClause's */ + + Node *limitOffset; /* # of result tuples to skip (int8 expr) */ + Node *limitCount; /* # of result tuples to return (int8 expr) */ + LimitOption limitOption; /* limit type */ + + List *rowMarks; /* a list of RowMarkClause's */ + + Node *setOperations; /* set-operation tree if this is top level of + * a UNION/INTERSECT/EXCEPT query */ + + /* + * A list of pg_constraint OIDs that the query depends on to be + * semantically valid + */ + List *constraintDeps pg_node_attr(query_jumble_ignore); + + /* a list of WithCheckOption's (added during rewrite) */ + List *withCheckOptions pg_node_attr(query_jumble_ignore); + + /* + * The following two fields identify the portion of the source text string + * containing this query. They are typically only populated in top-level + * Queries, not in sub-queries. When not set, they might both be zero, or + * both be -1 meaning "unknown". + */ + /* start location, or -1 if unknown */ + ParseLoc stmt_location; + /* length in bytes; 0 means "rest of string" */ + ParseLoc stmt_len pg_node_attr(query_jumble_ignore); ++======= + NodeTag type; + + CmdType commandType; /* select|insert|update|delete|merge|utility */ + + /* where did I come from? */ + QuerySource querySource pg_node_attr(query_jumble_ignore); + + /* + * query identifier (can be set by plugins); ignored for equal, as it + * might not be set; also not stored. This is the result of the query + * jumble, hence ignored. + * + * We store this as a signed value as this is the form it's displayed to + * users in places such as EXPLAIN and pg_stat_statements. Primarily this + * is done due to lack of an SQL type to represent the full range of + * uint64. + */ + int64 queryId pg_node_attr(equal_ignore, query_jumble_ignore, read_write_ignore, read_as(0)); + + /* do I set the command result tag? */ + bool canSetTag pg_node_attr(query_jumble_ignore); + + Node *utilityStmt; /* non-null if commandType == CMD_UTILITY */ + + /* + * rtable index of target relation for INSERT/UPDATE/DELETE/MERGE; 0 for + * SELECT. This is ignored in the query jumble as unrelated to the + * compilation of the query ID. + */ + int resultRelation pg_node_attr(query_jumble_ignore); + + /* has aggregates in tlist or havingQual */ + bool hasAggs pg_node_attr(query_jumble_ignore); + /* has window functions in tlist */ + bool hasWindowFuncs pg_node_attr(query_jumble_ignore); + /* has set-returning functions in tlist */ + bool hasTargetSRFs pg_node_attr(query_jumble_ignore); + /* has subquery SubLink */ + bool hasSubLinks pg_node_attr(query_jumble_ignore); + /* distinctClause is from DISTINCT ON */ + bool hasDistinctOn pg_node_attr(query_jumble_ignore); + /* WITH RECURSIVE was specified */ + bool hasRecursive pg_node_attr(query_jumble_ignore); + /* has INSERT/UPDATE/DELETE/MERGE in WITH */ + bool hasModifyingCTE pg_node_attr(query_jumble_ignore); + /* FOR [KEY] UPDATE/SHARE was specified */ + bool hasForUpdate pg_node_attr(query_jumble_ignore); + /* rewriter has applied some RLS policy */ + bool hasRowSecurity pg_node_attr(query_jumble_ignore); + /* parser has added an RTE_GROUP RTE */ + bool hasGroupRTE pg_node_attr(query_jumble_ignore); + /* is a RETURN statement */ + bool isReturn pg_node_attr(query_jumble_ignore); + + List *cteList; /* WITH list (of CommonTableExpr's) */ + + List *rtable; /* list of range table entries */ + + /* + * list of RTEPermissionInfo nodes for the rtable entries having + * perminfoindex > 0 + */ + List *rteperminfos pg_node_attr(query_jumble_ignore); + FromExpr *jointree; /* table join tree (FROM and WHERE clauses); + * also USING clause for MERGE */ + + List *mergeActionList; /* list of actions for MERGE (only) */ + + /* + * rtable index of target relation for MERGE to pull data. Initially, this + * is the same as resultRelation, but after query rewriting, if the target + * relation is a trigger-updatable view, this is the index of the expanded + * view subquery, whereas resultRelation is the index of the target view. + */ + int mergeTargetRelation pg_node_attr(query_jumble_ignore); + + /* join condition between source and target for MERGE */ + Node *mergeJoinCondition; + + List *targetList; /* target list (of TargetEntry) */ + + /* OVERRIDING clause */ + OverridingKind override pg_node_attr(query_jumble_ignore); + + OnConflictExpr *onConflict; /* ON CONFLICT DO [NOTHING | UPDATE] */ + + /* + * The following three fields describe the contents of the RETURNING list + * for INSERT/UPDATE/DELETE/MERGE. returningOldAlias and returningNewAlias + * are the alias names for OLD and NEW, which may be user-supplied values, + * the defaults "old" and "new", or NULL (if the default "old"/"new" is + * already in use as the alias for some other relation). + */ + char *returningOldAlias pg_node_attr(query_jumble_ignore); + char *returningNewAlias pg_node_attr(query_jumble_ignore); + List *returningList; /* return-values list (of TargetEntry) */ + + List *groupClause; /* a list of SortGroupClause's */ + bool groupDistinct; /* was GROUP BY DISTINCT used? */ + bool groupByAll; /* was GROUP BY ALL used? */ + + List *groupingSets; /* a list of GroupingSet's if present */ + + Node *havingQual; /* qualifications applied to groups */ + + /* ADDED: QUALIFY clause */ + Node *qualifyQual; /* qualifications applied to window functions */ + + List *windowClause; /* a list of WindowClause's */ + + List *distinctClause; /* a list of SortGroupClause's */ + + List *sortClause; /* a list of SortGroupClause's */ + + Node *limitOffset; /* # of result tuples to skip (int8 expr) */ + Node *limitCount; /* # of result tuples to return (int8 expr) */ + LimitOption limitOption; /* limit type */ + + List *rowMarks; /* a list of RowMarkClause's */ + + Node *setOperations; /* set-operation tree if this is top level of + * a UNION/INTERSECT/EXCEPT query */ + + /* + * A list of pg_constraint OIDs that the query depends on to be + * semantically valid + */ + List *constraintDeps pg_node_attr(query_jumble_ignore); + + /* a list of WithCheckOption's (added during rewrite) */ + List *withCheckOptions pg_node_attr(query_jumble_ignore); + + /* + * The following two fields identify the portion of the source text string + * containing this query. They are typically only populated in top-level + * Queries, not in sub-queries. When not set, they might both be zero, or + * both be -1 meaning "unknown". + */ + /* start location, or -1 if unknown */ + ParseLoc stmt_location; + /* length in bytes; 0 means "rest of string" */ + ParseLoc stmt_len pg_node_attr(query_jumble_ignore); ++>>>>>>> theirs } Query;