*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: execAmi.c,v 1.35 1999/05/25 16:08:34 momjian Exp $
+ * $Id: execAmi.c,v 1.36 1999/07/13 21:17:31 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "executor/nodeNestloop.h"
#include "executor/nodeHashjoin.h"
#include "executor/nodeHash.h"
-/***S*I***/
#include "executor/nodeGroup.h"
#include "executor/nodeAgg.h"
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.64 1999/05/25 16:09:11 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/readfuncs.c,v 1.65 1999/07/13 21:17:31 momjian Exp $
*
* NOTES
* Most of the read functions for plan nodes are tested. (In fact, they
token = lsptok(NULL, &length); /* skip :unionClause */
local_node->unionClause = nodeRead(true);
- /***S*I***/
token = lsptok(NULL, &length); /* skip :intersectClause */
local_node->intersectClause = nodeRead(true);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: analyze.c,v 1.110 1999/06/05 20:22:30 tgl Exp $
+ * $Id: analyze.c,v 1.111 1999/07/13 21:17:32 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "parser/parse_node.h"
#include "parser/parse_relation.h"
#include "parser/parse_target.h"
-/***S*I***/
#include "parser/parse_expr.h"
#include "catalog/pg_type.h"
#include "parse.h"
*/
qry->unionall = stmt->unionall;
- /***S*I***/
-
/*
* Just hand through the unionClause and intersectClause. We will
* handle it in the function Except_Intersect_Rewrite()
*/
qry->unionall = stmt->unionall;
- /***S*I***/
-
/*
* Just hand through the unionClause and intersectClause. We will
* handle it in the function Except_Intersect_Rewrite()
return qry;
}
-/***S*I***/
/* This function steps through the tree
* built up by the select_w_o_sort rule
* and builds a list of all SelectStmt Nodes found
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.88 1999/07/09 21:59:59 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.89 1999/07/13 21:17:33 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
*
*****************************************************************************/
-/***S*I***/
/* This rule used 'opt_column_list' between 'relation_name' and 'insert_rest'
* originally. When the second rule of 'insert_rest' was changed to use
* the new 'SelectStmt' rule (for INTERSECT and EXCEPT) it produced a shift/reduce
$$->groupClause = NIL;
$$->havingClause = NULL;
$$->unionClause = NIL;
- /***S*I***/
$$->intersectClause = NIL;
}
- /***S*I***/
/* We want the full power of SelectStatements including INTERSECT and EXCEPT
* for insertion */
| SelectStmt
$$->groupClause = NIL;
$$->havingClause = NULL;
$$->unionClause = NIL;
- /***S*I***/
$$->intersectClause = NIL;
}
| '(' columnList ')' SelectStmt
* CURSOR STATEMENTS
*
*****************************************************************************/
-/***S*I***/
CursorStmt: DECLARE name opt_cursor CURSOR FOR SelectStmt
{
SelectStmt *n;
* SELECT STATEMENTS
*
*****************************************************************************/
-/***S*I***/
/* The new 'SelectStmt' rule adapted for the optional use of INTERSECT EXCEPT and UNION
* accepts the use of '(' and ')' to select an order of set operations.
*
}
;
-/***S*I***/
/* This rule parses Select statements including UNION INTERSECT and EXCEPT.
* '(' and ')' can be used to specify the order of the operations
* (UNION EXCEPT INTERSECT). Without the use of '(' and ')' we want the
}
;
-/***S*I***/
SubSelect: SELECT opt_unique res_target_list2
result from_clause where_clause
group_clause having_clause
n->unique = $2;
n->unionall = FALSE;
n->targetList = $3;
- /***S*I***/
/* This is new: Subselects support the INTO clause
* which allows queries that are not part of the
* SQL92 standard and should not be formulated!
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.57 1999/05/12 07:22:52 thomas Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.58 1999/07/13 21:17:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
{"else", ELSE},
{"encoding", ENCODING},
{"end", END_TRANS},
- /***S*I***/
{"except", EXCEPT},
{"exclusive", EXCLUSIVE},
{"execute", EXECUTE},
{"insensitive", INSENSITIVE},
{"insert", INSERT},
{"instead", INSTEAD},
- /***S*I***/
{"intersect", INTERSECT},
{"interval", INTERVAL},
{"into", INTO},
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.48 1999/07/11 17:54:30 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteHandler.c,v 1.49 1999/07/13 21:17:35 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include "parser/parse_relation.h"
#include "nodes/parsenodes.h"
-/***S*I***/
#include "parser/parse_node.h"
#include "parser/parse_target.h"
modified,
sublevels_up + 1);
- /***S*I***/
tmp_lefthand = sub->lefthand;
foreach(tmp_oper, sub->oper)
{
List *rewritten,
*rewritten_item;
- /***S*I***/
-
/*
* Rewrite Union, Intersect and Except Queries to normal Union Queries
* using IN and NOT IN subselects
return rewritten;
}
-/***S*I***/
/* This function takes two targetlists as arguments and checks if the
* targetlists are compatible (i.e. both select for the same number of
* attributes and the types are compatible */
}
}
-/***S*I***/
/* Rewrites UNION INTERSECT and EXCEPT queries to semantiacally equivalent
* queries that use IN and NOT IN subselects.
*
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.32 1999/05/26 12:55:48 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.33 1999/07/13 21:17:36 momjian Exp $
*
*-------------------------------------------------------------------------
*/
offset,
sublevels_up + 1);
- /***S*I***/
-
/*
* Make sure the first argument of sub->oper points to the
* same var as sub->lefthand does otherwise we will run
new_index,
sublevels_up + 1);
- /***S*I***/
-
/*
* Make sure the first argument of sub->oper points to the
* same var as sub->lefthand does otherwise we will run
if (qual == NULL)
return;
- /***S*I***/
/* INTERSECT want's the original, but we need to copy - Jan */
/* copy = qual; */
copy = copyObject(qual);
if (havingQual == NULL)
return;
- /***S*I***/
/* INTERSECT want's the original, but we need to copy - Jan */
/* copy = havingQual; */
copy = copyObject(havingQual);
if (havingQual == NULL)
return;
- /***S*I***/
/* INTERSECT want's the original, but we need to copy - Jan */
/* copy = (Node *) make_notclause((Expr *)havingQual); */
copy = (Node *) make_notclause((Expr *) copyObject(havingQual));
if (qual == NULL)
return;
- /***S*I***/
/* INTERSECT want's the original, but we need to copy - Jan */
/* copy = (Node *) make_notclause((Expr *)qual); */
copy = (Node *) make_notclause((Expr *) copyObject(qual));
lfirst(sublink->lefthand);
- /***S*I***/
/* INTERSECT want's this - Jan */
/*
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: nodeGroup.h,v 1.10 1999/05/25 16:13:55 momjian Exp $
+ * $Id: nodeGroup.h,v 1.11 1999/07/13 21:17:37 momjian Exp $
*
*-------------------------------------------------------------------------
*/
extern void ExecEndGroup(Group *node);
extern void ExecReScanGroup(Group *node, ExprContext *exprCtxt, Plan *parent);
-/***S*I***/
extern void ExecReScanGroup(Group *node, ExprContext *exprCtxt, Plan *parent);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: parsenodes.h,v 1.74 1999/05/25 22:42:57 momjian Exp $
+ * $Id: parsenodes.h,v 1.75 1999/07/13 21:17:38 momjian Exp $
*
*-------------------------------------------------------------------------
*/
* BY */
Node *havingQual; /* qualification of each group */
- /***S*I***/
List *intersectClause;
List *unionClause; /* unions are linked under the previous
Node *havingClause; /* having conditional-expression */
List *unionClause; /* union subselect parameters */
bool unionall; /* union without unique sort */
- /***S*I***/
List *intersectClause;
List *forUpdate; /* FOR UPDATE clause */
} InsertStmt;
Node *whereClause; /* qualifications */
List *groupClause; /* group by clause */
Node *havingClause; /* having conditional-expression */
- /***S*I***/
List *intersectClause;
List *exceptClause;
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: analyze.h,v 1.7 1999/05/25 16:14:24 momjian Exp $
+ * $Id: analyze.h,v 1.8 1999/07/13 21:17:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
extern List *parse_analyze(List *pl, ParseState *parentParseState);
-/***S*I***/
extern void create_select_list(Node *ptr, List **select_list, bool *unionall_present);
extern Node *A_Expr_to_Expr(Node *ptr, bool *intersect_present);
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: elog.h,v 1.10 1999/02/13 23:22:18 momjian Exp $
+ * $Id: elog.h,v 1.11 1999/07/13 21:17:42 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#define ABORTX 0x4000 /* abort process after logging */
#endif
-/***S*I***/
/* Increase this to be able to use postmaster -d 3 with complex
* view definitions (which are transformed to very, very large INSERT statements
* and if -d 3 is used the query string of these statements is printed using
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.13 1999/04/26 05:28:47 meskes Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.14 1999/07/13 21:17:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
{"else", ELSE},
{"encoding", ENCODING},
{"end", END_TRANS},
- /***S*I***/
{"except", EXCEPT},
{"execute", EXECUTE},
{"insensitive", INSENSITIVE},
{"insert", INSERT},
{"instead", INSTEAD},
- /***S*I***/
{"intersect", INTERSECT},
{"interval", INTERVAL},
*
*****************************************************************************/
-/***S*I***/
/* This rule used 'opt_column_list' between 'relation_name' and 'insert_rest'
* originally. When the second rule of 'insert_rest' was changed to use
* the new 'SelectStmt' rule (for INTERSECT and EXCEPT) it produced a shift/red uce
*
*****************************************************************************/
-/***S*I***/
/* The new 'SelectStmt' rule adapted for the optional use of INTERSECT EXCEPT a nd UNION
* accepts the use of '(' and ')' to select an order of set operations.
* The rule returns a SelectStmt Node having the set operations attached to
$$ = cat4_str($1, $2, $3, $4);
}
-/***S*I***/
/* This rule parses Select statements including UNION INTERSECT and EXCEPT.
* '(' and ')' can be used to specify the order of the operations
* (UNION EXCEPT INTERSECT). Without the use of '(' and ')' we want the
}
;
-/***S*I***/
SubSelect: SELECT opt_unique res_target_list2
result from_clause where_clause
group_clause having_clause