aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_oper.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2010-07-30 17:56:59 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2010-07-30 17:56:59 +0000
commit6b8494a3adc009247ada8a7a7adc1c488396161d (patch)
treecb30d4d85b2ebbe479df32fd0d3632329a36c3eb /src/backend/parser/parse_oper.c
parentb08fd11508a2b36e64f456d8e0345f1c66dae333 (diff)
downloadpostgresql-6b8494a3adc009247ada8a7a7adc1c488396161d.tar.gz
postgresql-6b8494a3adc009247ada8a7a7adc1c488396161d.zip
Improved version of patch to protect pg_get_expr() against misuse:
look through join alias Vars to avoid breaking join queries, and move the test to someplace where it will catch more possible ways of calling a function. We still ought to throw away the whole thing in favor of a data-type-based solution, but that's not feasible in the back branches. Completion of back-port of my patch of yesterday.
Diffstat (limited to 'src/backend/parser/parse_oper.c')
-rw-r--r--src/backend/parser/parse_oper.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/parser/parse_oper.c b/src/backend/parser/parse_oper.c
index 16ed3a11ed5..198a2bc4e9a 100644
--- a/src/backend/parser/parse_oper.c
+++ b/src/backend/parser/parse_oper.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/parse_oper.c,v 1.109 2009/06/13 15:42:09 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/parse_oper.c,v 1.109.2.1 2010/07/30 17:56:59 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -880,6 +880,9 @@ make_op(ParseState *pstate, List *opname, Node *ltree, Node *rtree,
ReleaseSysCache(tup);
+ /* Hack to protect pg_get_expr() against misuse */
+ check_pg_get_expr_args(pstate, result->opfuncid, args);
+
return (Expr *) result;
}
@@ -1008,6 +1011,9 @@ make_scalar_array_op(ParseState *pstate, List *opname,
ReleaseSysCache(tup);
+ /* Hack to protect pg_get_expr() against misuse */
+ check_pg_get_expr_args(pstate, result->opfuncid, args);
+
return (Expr *) result;
}