summaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_oper.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2010-07-30 17:57:07 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2010-07-30 17:57:07 +0000
commit9e6dc1372f7ece296fc4a02b4c69f5ef86366acc (patch)
tree4feb3922513b39471e6e55f9ffad938208b5b929 /src/backend/parser/parse_oper.c
parent242dc3819b9667eb4a8118a779932d42dce7d849 (diff)
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 6b23fbb9e9a..49b7b541215 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.101 2008/01/11 18:39:41 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/parse_oper.c,v 1.101.2.1 2010/07/30 17:57:07 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1059,6 +1059,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;
}
@@ -1131,6 +1134,9 @@ make_op_expr(ParseState *pstate, Operator op,
result->opretset = get_func_retset(opform->oprcode);
result->args = args;
+ /* Hack to protect pg_get_expr() against misuse */
+ check_pg_get_expr_args(pstate, result->opfuncid, args);
+
return (Expr *) result;
}