mirror of
https://github.com/postgres/postgres.git
synced 2025-06-03 00:02:26 -04:00
A couple other cosmetic cleanups in new List stuff.
This commit is contained in:
parent
437063bdc4
commit
0858ed20d2
@ -3,7 +3,7 @@
|
|||||||
* back to source text
|
* back to source text
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* 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.
|
* This software is copyrighted by Jan Wieck - Hamburg.
|
||||||
*
|
*
|
||||||
@ -2274,17 +2274,14 @@ static void
|
|||||||
get_names_for_var(Var *var, deparse_context *context,
|
get_names_for_var(Var *var, deparse_context *context,
|
||||||
char **schemaname, char **refname, char **attname)
|
char **schemaname, char **refname, char **attname)
|
||||||
{
|
{
|
||||||
ListCell *nslist_item = list_head(context->namespaces);
|
|
||||||
int sup = var->varlevelsup;
|
|
||||||
deparse_namespace *dpns;
|
deparse_namespace *dpns;
|
||||||
RangeTblEntry *rte;
|
RangeTblEntry *rte;
|
||||||
|
|
||||||
/* Find appropriate nesting depth */
|
/* Find appropriate nesting depth */
|
||||||
while (sup-- > 0 && nslist_item != NULL)
|
if (var->varlevelsup >= list_length(context->namespaces))
|
||||||
nslist_item = lnext(nslist_item);
|
|
||||||
if (nslist_item == NULL)
|
|
||||||
elog(ERROR, "bogus varlevelsup: %d", var->varlevelsup);
|
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 */
|
/* Find the relevant RTE */
|
||||||
if (var->varno >= 1 && var->varno <= length(dpns->rtable))
|
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) 1996-2003, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* 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.)
|
* always be so; try to be careful to maintain the distinction.)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define LIST_CELL_TYPE ListCell
|
|
||||||
|
|
||||||
typedef struct ListCell ListCell;
|
typedef struct ListCell ListCell;
|
||||||
typedef struct List List;
|
typedef struct List List;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user