aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_clause.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1997-11-26 03:43:18 +0000
committerBruce Momjian <bruce@momjian.us>1997-11-26 03:43:18 +0000
commitb7044266187a9f646589cb3aa2482d028cd0a87f (patch)
treefbb5f1a7472a56ddb4d47b639035ecec6641b97e /src/backend/parser/parse_clause.c
parent97ad0b1cd43527295159f2081be4d002be91f374 (diff)
downloadpostgresql-b7044266187a9f646589cb3aa2482d028cd0a87f.tar.gz
postgresql-b7044266187a9f646589cb3aa2482d028cd0a87f.zip
Make parser functions static where possible.
Diffstat (limited to 'src/backend/parser/parse_clause.c')
-rw-r--r--src/backend/parser/parse_clause.c94
1 files changed, 43 insertions, 51 deletions
diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c
index 3f419716d80..ad40222ba6d 100644
--- a/src/backend/parser/parse_clause.c
+++ b/src/backend/parser/parse_clause.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.2 1997/11/26 01:11:16 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.3 1997/11/26 03:42:39 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -25,45 +25,9 @@
#include "parser/parse_relation.h"
#include "parser/parse_target.h"
-/*
- * parseFromClause -
- * turns the table references specified in the from-clause into a
- * range table. The range table may grow as we transform the expressions
- * in the target list. (Note that this happens because in POSTQUEL, we
- * allow references to relations not specified in the from-clause. We
- * also allow that in our POST-SQL)
- *
- */
-void
-parseFromClause(ParseState *pstate, List *frmList)
-{
- List *fl;
-
- foreach(fl, frmList)
- {
- RangeVar *r = lfirst(fl);
- RelExpr *baserel = r->relExpr;
- char *relname = baserel->relname;
- char *refname = r->name;
- RangeTblEntry *rte;
-
- if (refname == NULL)
- refname = relname;
-
- /*
- * marks this entry to indicate it comes from the FROM clause. In
- * SQL, the target list can only refer to range variables
- * specified in the from clause but we follow the more powerful
- * POSTQUEL semantics and automatically generate the range
- * variable if not specified. However there are times we need to
- * know whether the entries are legitimate.
- *
- * eg. select * from foo f where f.x = 1; will generate wrong answer
- * if we expand * to foo.x.
- */
- rte = addRangeTableEntry(pstate, relname, refname, baserel->inh, TRUE);
- }
-}
+static TargetEntry *find_targetlist_entry(ParseState *pstate,
+ SortGroupBy *sortgroupby, List *tlist);
+static void parseFromClause(ParseState *pstate, List *frmList);
/*
* makeRangeTable -
@@ -92,12 +56,6 @@ makeRangeTable(ParseState *pstate, char *relname, List *frmList)
/* will close relation later */
}
-/*****************************************************************************
- *
- * Where Clause
- *
- *****************************************************************************/
-
/*
* transformWhereClause -
* transforms the qualification and make sure it is of type Boolean
@@ -123,11 +81,45 @@ transformWhereClause(ParseState *pstate, Node *a_expr)
return qual;
}
-/*****************************************************************************
- *
- * Sort Clause
+/*
+ * parseFromClause -
+ * turns the table references specified in the from-clause into a
+ * range table. The range table may grow as we transform the expressions
+ * in the target list. (Note that this happens because in POSTQUEL, we
+ * allow references to relations not specified in the from-clause. We
+ * also allow that in our POST-SQL)
*
- *****************************************************************************/
+ */
+static void
+parseFromClause(ParseState *pstate, List *frmList)
+{
+ List *fl;
+
+ foreach(fl, frmList)
+ {
+ RangeVar *r = lfirst(fl);
+ RelExpr *baserel = r->relExpr;
+ char *relname = baserel->relname;
+ char *refname = r->name;
+ RangeTblEntry *rte;
+
+ if (refname == NULL)
+ refname = relname;
+
+ /*
+ * marks this entry to indicate it comes from the FROM clause. In
+ * SQL, the target list can only refer to range variables
+ * specified in the from clause but we follow the more powerful
+ * POSTQUEL semantics and automatically generate the range
+ * variable if not specified. However there are times we need to
+ * know whether the entries are legitimate.
+ *
+ * eg. select * from foo f where f.x = 1; will generate wrong answer
+ * if we expand * to foo.x.
+ */
+ rte = addRangeTableEntry(pstate, relname, refname, baserel->inh, TRUE);
+ }
+}
/*
* find_targetlist_entry -
@@ -135,7 +127,7 @@ transformWhereClause(ParseState *pstate, Node *a_expr)
* and range
*
*/
-TargetEntry *
+static TargetEntry *
find_targetlist_entry(ParseState *pstate, SortGroupBy *sortgroupby, List *tlist)
{
List *i;