diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-05-25 22:42:19 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-05-25 22:42:19 +0000 |
commit | ff566b224198ea5e9ce609d9e9c66fc9032ebae2 (patch) | |
tree | 3667243ddca76d36e5d7464bc1191952bce11136 /src/backend/parser/parse_expr.c | |
parent | 610abfd57b2315a145d800e8f2d97b03509237df (diff) | |
download | postgresql-ff566b224198ea5e9ce609d9e9c66fc9032ebae2.tar.gz postgresql-ff566b224198ea5e9ce609d9e9c66fc9032ebae2.zip |
Modify raw parsetree representation returned by gram.y for SubLinks:
the oper field should be a valid Node structure so it can be dumped by
outfuncs.c without risk of coredump. (We had been using a raw pointer
to character string, which surely is NOT a valid Node.) This doesn't
cause any backwards compatibility problems for stored rules, since
raw unanalyzed parsetrees are never stored.
Diffstat (limited to 'src/backend/parser/parse_expr.c')
-rw-r--r-- | src/backend/parser/parse_expr.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c index 0bb81dd2475..0f16f25aff2 100644 --- a/src/backend/parser/parse_expr.c +++ b/src/backend/parser/parse_expr.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.76 2000/04/12 17:15:26 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.77 2000/05/25 22:42:18 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -324,23 +324,25 @@ transformExpr(ParseState *pstate, Node *expr, int precedence) else { /* ALL, ANY, or MULTIEXPR: generate operator list */ - char *op = lfirst(sublink->oper); List *left_list = sublink->lefthand; List *right_list = qtree->targetList; + char *op; List *elist; foreach(elist, left_list) lfirst(elist) = transformExpr(pstate, lfirst(elist), precedence); + Assert(IsA(sublink->oper, A_Expr)); + op = ((A_Expr *) sublink->oper)->opname; + sublink->oper = NIL; + /* Combining operators other than =/<> is dubious... */ if (length(left_list) != 1 && strcmp(op, "=") != 0 && strcmp(op, "<>") != 0) elog(ERROR, "Row comparison cannot use '%s'", op); - sublink->oper = NIL; - /* * Scan subquery's targetlist to find values that will * be matched against lefthand values. We need to |