diff options
Diffstat (limited to 'src/backend/parser/parse_target.c')
-rw-r--r-- | src/backend/parser/parse_target.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/backend/parser/parse_target.c b/src/backend/parser/parse_target.c index b70d92b9550..29010250151 100644 --- a/src/backend/parser/parse_target.c +++ b/src/backend/parser/parse_target.c @@ -42,7 +42,8 @@ static Node *transformAssignmentIndirection(ParseState *pstate, Oid targetTypeId, int32 targetTypMod, Oid targetCollation, - ListCell *indirection, + List *indirection, + ListCell *indirection_cell, Node *rhs, int location); static Node *transformAssignmentSubscripts(ParseState *pstate, @@ -53,6 +54,7 @@ static Node *transformAssignmentSubscripts(ParseState *pstate, Oid targetCollation, List *subscripts, bool isSlice, + List *indirection, ListCell *next_indirection, Node *rhs, int location); @@ -561,6 +563,7 @@ transformAssignedExpr(ParseState *pstate, attrtype, attrtypmod, attrcollation, + indirection, list_head(indirection), (Node *) expr, location); @@ -662,8 +665,9 @@ updateTargetListEntry(ParseState *pstate, * collation of the object to be assigned to (initially the target column, * later some subobject). * - * indirection is the sublist remaining to process. When it's NULL, we're - * done recursing and can just coerce and return the RHS. + * indirection is the list of indirection nodes, and indirection_cell is the + * start of the sublist remaining to process. When it's NULL, we're done + * recursing and can just coerce and return the RHS. * * rhs is the already-transformed value to be assigned; note it has not been * coerced to any particular type. @@ -681,7 +685,8 @@ transformAssignmentIndirection(ParseState *pstate, Oid targetTypeId, int32 targetTypMod, Oid targetCollation, - ListCell *indirection, + List *indirection, + ListCell *indirection_cell, Node *rhs, int location) { @@ -690,7 +695,7 @@ transformAssignmentIndirection(ParseState *pstate, bool isSlice = false; ListCell *i; - if (indirection && !basenode) + if (indirection_cell && !basenode) { /* * Set up a substitution. We abuse CaseTestExpr for this. It's safe @@ -712,7 +717,7 @@ transformAssignmentIndirection(ParseState *pstate, * subscripting. Adjacent A_Indices nodes have to be treated as a single * multidimensional subscript operation. */ - for_each_cell(i, indirection) + for_each_cell(i, indirection, indirection_cell) { Node *n = lfirst(i); @@ -754,6 +759,7 @@ transformAssignmentIndirection(ParseState *pstate, targetCollation, subscripts, isSlice, + indirection, i, rhs, location); @@ -803,7 +809,8 @@ transformAssignmentIndirection(ParseState *pstate, fieldTypeId, fieldTypMod, fieldCollation, - lnext(i), + indirection, + lnext(indirection, i), rhs, location); @@ -840,6 +847,7 @@ transformAssignmentIndirection(ParseState *pstate, targetCollation, subscripts, isSlice, + indirection, NULL, rhs, location); @@ -892,6 +900,7 @@ transformAssignmentSubscripts(ParseState *pstate, Oid targetCollation, List *subscripts, bool isSlice, + List *indirection, ListCell *next_indirection, Node *rhs, int location) @@ -931,6 +940,7 @@ transformAssignmentSubscripts(ParseState *pstate, typeNeeded, containerTypMod, collationNeeded, + indirection, next_indirection, rhs, location); |