aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/parser')
-rw-r--r--src/backend/parser/gram.y20
-rw-r--r--src/backend/parser/parse_expr.c10
2 files changed, 16 insertions, 14 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index e4f59bc605d..ac7beb383d8 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.167 2000/04/07 13:39:34 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.168 2000/05/25 22:42:17 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -4153,7 +4153,7 @@ row_expr: '(' row_descriptor ')' IN '(' SubSelect ')'
{
SubLink *n = makeNode(SubLink);
n->lefthand = $2;
- n->oper = lcons("=", NIL);
+ n->oper = (List *) makeA_Expr(OP, "=", NULL, NULL);
n->useor = false;
n->subLinkType = ANY_SUBLINK;
n->subselect = $6;
@@ -4163,7 +4163,7 @@ row_expr: '(' row_descriptor ')' IN '(' SubSelect ')'
{
SubLink *n = makeNode(SubLink);
n->lefthand = $2;
- n->oper = lcons("<>", NIL);
+ n->oper = (List *) makeA_Expr(OP, "<>", NULL, NULL);
n->useor = true;
n->subLinkType = ALL_SUBLINK;
n->subselect = $7;
@@ -4173,8 +4173,8 @@ row_expr: '(' row_descriptor ')' IN '(' SubSelect ')'
{
SubLink *n = makeNode(SubLink);
n->lefthand = $2;
- n->oper = lcons($4, NIL);
- if (strcmp($4,"<>") == 0)
+ n->oper = (List *) makeA_Expr(OP, $4, NULL, NULL);
+ if (strcmp($4, "<>") == 0)
n->useor = true;
else
n->useor = false;
@@ -4186,8 +4186,8 @@ row_expr: '(' row_descriptor ')' IN '(' SubSelect ')'
{
SubLink *n = makeNode(SubLink);
n->lefthand = $2;
- n->oper = lcons($4, NIL);
- if (strcmp($4,"<>") == 0)
+ n->oper = (List *) makeA_Expr(OP, $4, NULL, NULL);
+ if (strcmp($4, "<>") == 0)
n->useor = true;
else
n->useor = false;
@@ -4436,7 +4436,7 @@ a_expr: c_expr
{
SubLink *n = (SubLink *)$4;
n->lefthand = lcons($1, NIL);
- n->oper = lcons("=", NIL);
+ n->oper = (List *) makeA_Expr(OP, "=", NULL, NULL);
n->useor = false;
n->subLinkType = ANY_SUBLINK;
$$ = (Node *)n;
@@ -4463,7 +4463,7 @@ a_expr: c_expr
{
SubLink *n = (SubLink *)$5;
n->lefthand = lcons($1, NIL);
- n->oper = lcons("<>", NIL);
+ n->oper = (List *) makeA_Expr(OP, "<>", NULL, NULL);
n->useor = false;
n->subLinkType = ALL_SUBLINK;
$$ = (Node *)n;
@@ -4487,7 +4487,7 @@ a_expr: c_expr
{
SubLink *n = makeNode(SubLink);
n->lefthand = lcons($1, NIL);
- n->oper = lcons($2, NIL);
+ n->oper = (List *) makeA_Expr(OP, $2, NULL, NULL);
n->useor = false; /* doesn't matter since only one col */
n->subLinkType = $3;
n->subselect = $5;
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