提交 0858ed20 编写于 作者: T Tom Lane

A couple other cosmetic cleanups in new List stuff.

上级 437063bd
......@@ -3,7 +3,7 @@
* back to source text
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.167 2004/05/26 04:41:38 neilc Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.168 2004/05/26 19:30:12 tgl Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
......@@ -2274,17 +2274,14 @@ static void
get_names_for_var(Var *var, deparse_context *context,
char **schemaname, char **refname, char **attname)
{
ListCell *nslist_item = list_head(context->namespaces);
int sup = var->varlevelsup;
deparse_namespace *dpns;
RangeTblEntry *rte;
/* Find appropriate nesting depth */
while (sup-- > 0 && nslist_item != NULL)
nslist_item = lnext(nslist_item);
if (nslist_item == NULL)
if (var->varlevelsup >= list_length(context->namespaces))
elog(ERROR, "bogus varlevelsup: %d", var->varlevelsup);
dpns = (deparse_namespace *) lfirst(nslist_item);
dpns = (deparse_namespace *) list_nth(context->namespaces,
var->varlevelsup);
/* Find the relevant RTE */
if (var->varno >= 1 && var->varno <= length(dpns->rtable))
......
......@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/nodes/pg_list.h,v 1.44 2004/05/26 04:41:45 neilc Exp $
* $PostgreSQL: pgsql/src/include/nodes/pg_list.h,v 1.45 2004/05/26 19:30:17 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -49,8 +49,6 @@
* always be so; try to be careful to maintain the distinction.)
*/
#define LIST_CELL_TYPE ListCell
typedef struct ListCell ListCell;
typedef struct List List;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册