diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-11-09 02:36:59 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-11-09 02:36:59 +0000 |
commit | 2ace38d226246b83e5cc4d8f4063a82a485ddc95 (patch) | |
tree | 5ba7f075efde9d793b927253f28b5802c6806322 /src/backend/executor/execCurrent.c | |
parent | 39bd3fd1db6f3aa3764d4a1bebcd71c4e9c00281 (diff) | |
download | postgresql-2ace38d226246b83e5cc4d8f4063a82a485ddc95.tar.gz postgresql-2ace38d226246b83e5cc4d8f4063a82a485ddc95.zip |
Fix WHERE CURRENT OF to work as designed within plpgsql. The argument
can be the name of a plpgsql cursor variable, which formerly was converted
to $N before the core parser saw it, but that's no longer the case.
Deal with plain name references to plpgsql variables, and add a regression
test case that exposes the failure.
Diffstat (limited to 'src/backend/executor/execCurrent.c')
-rw-r--r-- | src/backend/executor/execCurrent.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/executor/execCurrent.c b/src/backend/executor/execCurrent.c index 35dc05a52b8..b1b9289c262 100644 --- a/src/backend/executor/execCurrent.c +++ b/src/backend/executor/execCurrent.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/backend/executor/execCurrent.c,v 1.13 2009/11/04 22:26:05 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/executor/execCurrent.c,v 1.14 2009/11/09 02:36:56 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -20,7 +20,7 @@ #include "utils/portal.h" -static char *fetch_param_value(ExprContext *econtext, int paramId); +static char *fetch_cursor_param_value(ExprContext *econtext, int paramId); static ScanState *search_plan_tree(PlanState *node, Oid table_oid); @@ -51,7 +51,7 @@ execCurrentOf(CurrentOfExpr *cexpr, if (cexpr->cursor_name) cursor_name = cexpr->cursor_name; else - cursor_name = fetch_param_value(econtext, cexpr->cursor_param); + cursor_name = fetch_cursor_param_value(econtext, cexpr->cursor_param); /* Fetch table name for possible use in error messages */ table_name = get_rel_name(table_oid); @@ -203,12 +203,12 @@ execCurrentOf(CurrentOfExpr *cexpr, } /* - * fetch_param_value + * fetch_cursor_param_value * * Fetch the string value of a param, verifying it is of type REFCURSOR. */ static char * -fetch_param_value(ExprContext *econtext, int paramId) +fetch_cursor_param_value(ExprContext *econtext, int paramId) { ParamListInfo paramInfo = econtext->ecxt_param_list_info; |