mirror of
https://github.com/postgres/postgres.git
synced 2026-07-15 20:52:53 -04:00
When parsing expressions like (old).colname and (old).* in a RETURNING list, the parser would lose track of the intended varreturningtype, and therefore return incorrect results. The root cause was code using GetNSItemByRangeTablePosn() to find a namespace item from its rtindex and levelsup, without taking into account returningtype, which would return the wrong namespace item. Fix by adding a new function GetNSItemByVar() that does take returningtype into account. Backpatch to v18, where support for RETURNING OLD/NEW was added. Bug: #19516 Reported-by: Marko Grujic <markoog@gmail.com> Author: Marko Grujic <markoog@gmail.com> Suggested-by: Dean Rasheed <dean.a.rasheed@gmail.com> Reviewed-by: Dean Rasheed <dean.a.rasheed@gmail.com> Discussion: https://postgr.es/m/CAOvwyF2cO_5mAt=w=y-dFnaG5UkZ+3H8nSDoKF_iuWZHsU2ARg@mail.gmail.com Backpatch-through: 18 |
||
|---|---|---|
| .. | ||
| analyze.h | ||
| kwlist.h | ||
| parse_agg.h | ||
| parse_clause.h | ||
| parse_coerce.h | ||
| parse_collate.h | ||
| parse_cte.h | ||
| parse_enr.h | ||
| parse_expr.h | ||
| parse_func.h | ||
| parse_graphtable.h | ||
| parse_merge.h | ||
| parse_node.h | ||
| parse_oper.h | ||
| parse_param.h | ||
| parse_relation.h | ||
| parse_target.h | ||
| parse_type.h | ||
| parse_utilcmd.h | ||
| parser.h | ||
| parsetree.h | ||
| scanner.h | ||
| scansup.h | ||