Fix plpgsql named-cursor-parameter feature for variable name conflicts.
Tom Lane <tgl@sss.pgh.pa.us>
Fix plpgsql named-cursor-parameter feature for variable name conflicts. The parser got confused if a cursor parameter had the same name as a plpgsql variable. Reported and diagnosed by Yeb Havinga, though this isn't exactly his proposed fix. Also, some mostly-but-not-entirely-cosmetic adjustments to the original named-cursor-parameter patch, for code readability and better error diagnostics.
Files
| Path | Change | +/− |
|---|---|---|
| src/pl/plpgsql/src/gram.y | modified | +22 −17 |
| src/test/regress/expected/plpgsql.out | modified | +19 −0 |
| src/test/regress/sql/plpgsql.sql | modified | +15 −0 |