1111 *
1212 *
1313 * IDENTIFICATION
14- * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.391 2003/01/08 00:22:27 tgl Exp $
14+ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.392 2003/01/09 20:50:51 tgl Exp $
1515 *
1616 * HISTORY
1717 * AUTHORDATEMAJOR EVENT
@@ -5420,40 +5420,39 @@ opt_interval:
54205420
54215421/* Expressions using row descriptors
54225422 * Define row_descriptor to allow yacc to break the reduce/reduce conflict
5423- * with singleton expressions. Use SQL99's ROW keyword to allow rows of
5424- * one element.
5423+ * with singleton expressions. Use SQL99's ROW keyword to allow rows of
5424+ * one element.
54255425*/
54265426r_expr: row IN_P select_with_parens
54275427{
54285428SubLink *n = makeNode(SubLink);
54295429n->lefthand =$1 ;
54305430n->oper = (List *) makeSimpleA_Expr(OP," =" ,NULL ,NULL );
5431- n->useor =FALSE ;
54325431n->subLinkType = ANY_SUBLINK;
5432+ /* operIsEquals and useOr will be set later*/
54335433n->subselect =$3 ;
54345434$$ = (Node *)n;
54355435}
54365436| row NOT IN_P select_with_parens
54375437{
5438+ /* Make an IN node*/
54385439SubLink *n = makeNode(SubLink);
54395440n->lefthand =$1 ;
5440- n->oper = (List *) makeSimpleA_Expr(OP," <> " ,NULL ,NULL );
5441- n->useor =TRUE ;
5442- n->subLinkType = ALL_SUBLINK;
5441+ n->oper = (List *) makeSimpleA_Expr(OP," = " ,NULL ,NULL );
5442+ n->subLinkType =ANY_SUBLINK ;
5443+ /* operIsEquals and useOr will be set later */
54435444n->subselect =$4 ;
5444- $$ = (Node *)n;
5445+ /* Stick a NOT on top*/
5446+ $$ = (Node *) makeA_Expr(NOT, NIL,NULL , (Node *) n);
54455447}
54465448| row qual_all_Op sub_type select_with_parens
54475449%prec Op
54485450{
54495451SubLink *n = makeNode(SubLink);
54505452n->lefthand =$1 ;
54515453n->oper = (List *) makeA_Expr(OP,$2 ,NULL ,NULL );
5452- if (strcmp(strVal(llast($2 ))," <>" ) ==0 )
5453- n->useor =TRUE ;
5454- else
5455- n->useor =FALSE ;
54565454n->subLinkType =$3 ;
5455+ /* operIsEquals and useOr will be set later*/
54575456n->subselect =$4 ;
54585457$$ = (Node *)n;
54595458}
@@ -5463,11 +5462,8 @@ r_expr: row IN_P select_with_parens
54635462SubLink *n = makeNode(SubLink);
54645463n->lefthand =$1 ;
54655464n->oper = (List *) makeA_Expr(OP,$2 ,NULL ,NULL );
5466- if (strcmp(strVal(llast($2 ))," <>" ) ==0 )
5467- n->useor =TRUE ;
5468- else
5469- n->useor =FALSE ;
54705465n->subLinkType = MULTIEXPR_SUBLINK;
5466+ /* operIsEquals and useOr will be set later*/
54715467n->subselect =$3 ;
54725468$$ = (Node *)n;
54735469}
@@ -5850,8 +5846,8 @@ a_expr:c_expr{ $$ = $1; }
58505846SubLink *n = (SubLink *)$3 ;
58515847n->lefthand = makeList1($1 );
58525848n->oper = (List *) makeSimpleA_Expr(OP," =" ,NULL ,NULL );
5853- n->useor =FALSE ;
58545849n->subLinkType = ANY_SUBLINK;
5850+ /* operIsEquals and useOr will be set later*/
58555851$$ = (Node *)n;
58565852}
58575853else
@@ -5875,12 +5871,14 @@ a_expr:c_expr{ $$ = $1; }
58755871/* in_expr returns a SubLink or a list of a_exprs*/
58765872if (IsA($4 , SubLink))
58775873{
5874+ /* Make an IN node*/
58785875SubLink *n = (SubLink *)$4 ;
58795876n->lefthand = makeList1($1 );
5880- n->oper = (List *) makeSimpleA_Expr(OP," <>" ,NULL ,NULL );
5881- n->useor =FALSE ;
5882- n->subLinkType = ALL_SUBLINK;
5883- $$ = (Node *)n;
5877+ n->oper = (List *) makeSimpleA_Expr(OP," =" ,NULL ,NULL );
5878+ n->subLinkType = ANY_SUBLINK;
5879+ /* operIsEquals and useOr will be set later*/
5880+ /* Stick a NOT on top*/
5881+ $$ = (Node *) makeA_Expr(NOT, NIL,NULL , (Node *) n);
58845882}
58855883else
58865884{
@@ -5903,8 +5901,8 @@ a_expr:c_expr{ $$ = $1; }
59035901SubLink *n = makeNode(SubLink);
59045902n->lefthand = makeList1($1 );
59055903n->oper = (List *) makeA_Expr(OP,$2 ,NULL ,NULL );
5906- n->useor =FALSE ;/* doesn't matter since only one col*/
59075904n->subLinkType =$3 ;
5905+ /* operIsEquals and useOr will be set later*/
59085906n->subselect =$4 ;
59095907$$ = (Node *)n;
59105908}
@@ -6447,7 +6445,6 @@ c_expr:columnref{ $$ = (Node *) $1; }
64476445SubLink *n = makeNode(SubLink);
64486446n->lefthand = NIL;
64496447n->oper = NIL;
6450- n->useor =FALSE ;
64516448n->subLinkType = EXPR_SUBLINK;
64526449n->subselect =$1 ;
64536450$$ = (Node *)n;
@@ -6457,7 +6454,6 @@ c_expr:columnref{ $$ = (Node *) $1; }
64576454SubLink *n = makeNode(SubLink);
64586455n->lefthand = NIL;
64596456n->oper = NIL;
6460- n->useor =FALSE ;
64616457n->subLinkType = EXISTS_SUBLINK;
64626458n->subselect =$2 ;
64636459$$ = (Node *)n;