Fix missing lfirst() in ListTableAsAttrs(). This code
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 15 Feb 2000 23:09:08 +0000 (23:09 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 15 Feb 2000 23:09:08 +0000 (23:09 +0000)
doesn't seem to be used at the moment, but as long as I'm looking at it...

src/backend/parser/parse_clause.c

index d6ccbeaa5c6a02863f22f1d1617868b73874105f..a6549015af991c54f33652013ed356943105ff6c 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.53 2000/02/15 07:47:37 tgl Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.54 2000/02/15 23:09:08 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -172,14 +172,13 @@ ListTableAsAttrs(ParseState *pstate, char *table);
 List *
 ListTableAsAttrs(ParseState *pstate, char *table)
 {
-   List *rlist = NULL;
+   Attr *attr = expandTable(pstate, table, TRUE);
+   List *rlist = NIL;
    List *col;
 
-   Attr *attr = expandTable(pstate, table, TRUE);
    foreach(col, attr->attrs)
    {
-       Attr *a;
-       a = makeAttr(table, strVal((Value *) col));
+       Attr *a = makeAttr(table, strVal((Value *) lfirst(col)));
        rlist = lappend(rlist, a);
    }