Syntax errors in current tree - Mailing list pgsql-hackers

From D'Arcy" "J.M." Cain
Subject Syntax errors in current tree
Date
Msg-id m10274q-0000bmC@druid.net
Whole thread Raw
Responses Re: [HACKERS] Syntax errors in current tree  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
really hesitate to make this criticism given all the work people are
doing on the system and all the great features and fixes that are
being added but could we please make it a hard and fast rule that
nothing gets added into the tree until the person adding it has at
least compiled the source, if not a full regression test.  I have
finally jumped in and tried to add full primary key support but I
keep stumbling over simple syntax errors in files I am not working
on but that keep me from fully testing my own changes.  Here's what
I get compiling gram.y[c].

gcc -I../../include -I../../backend   -I/usr/local/include -O2 -pipe  -Wall -Wmissing-prototypes -I.. -Wno-error   -c
gram.c-o gram.o
 
/usr/local/share/bison.simple: In function `yyparse':
/usr/local/share/bison.simple:327: warning: implicit declaration of function `yyerror'
/usr/local/share/bison.simple:387: warning: implicit declaration of function `yylex'
gram.y:2797: `forUpdate' undeclared (first use in this function)
gram.y:2797: (Each undeclared identifier is reported only once
gram.y:2797: for each function it appears in.)
gram.y:2800: syntax error before `->'
gram.y:2800: syntax error before `)'
gram.y:2804: `n' undeclared (first use in this function)
gram.y:2815: case label not within a switch statement
gram.y:2834: break statement not within loop or switch
gram.y:2835: case label not within a switch statement
gram.y:2838: break statement not within loop or switch
gram.y:2839: case label not within a switch statement
gram.y:2843: break statement not within loop or switch
...etc for many more lines.

I assume that line 2800 in gram.y is missing a paren and should have the
following change.

*** ../src.original/./backend/parser/gram.y Sun Jan 17 23:49:29 1999
--- ./backend/parser/gram.y Sun Jan 17 23:59:13 1999
***************
*** 2797,2803 ****                 first_select>forUpdate = $3;                 $$ = (Node *)first_select;
}
 
!               if ((SelectStmt *)$$)->forUpdate != NULL)               {                   SelectStmt *n = (SelectStmt
*)$1;
--- 2797,2803 ----                 first_select>forUpdate = $3;                 $$ = (Node *)first_select;
}
 
!               if (((SelectStmt *)$$)->forUpdate != NULL)               {                   SelectStmt *n =
(SelectStmt*)$1;
 

But I can't tell what should be done for the missing declaration for
forUpdate.  Can whoever added this please complete it.  It appears
4 times in the file.


Further, backend/libpq/pqcomprim.c is missing a header that causes the
compile to fail.

*** ../src.original/./backend/libpq/pqcomprim.c Sun Jan 17 23:43:29 1999
--- ./backend/libpq/pqcomprim.c Sun Jan 17 23:43:43 1999
***************
*** 1,5 ****
--- 1,6 ----         #include <stdlib.h>            #include <stdio.h>            
+ #include <errno.h>             #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h>

Sorry if I seem a little frustrated.  It's only because I am.  This isn't
the first time this has happened while I was trying to work on the code.
I don't think a full compile after extracting your diffs but before
sending them in is so much to ask, is it?  I'm not, after all, asking
for full regression testing.

Anyway, I have (I think) all the changes needed to put full primary key
support in.  As soon as I can test them I'll send them in.  Or maybe I
should send them in now without fully testing them.  (Wry joke.)

-- 
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 424 2871     (DoD#0082)    (eNTP)   |  what's for dinner.


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] fix pg_dump to dump sequences created by SERIAL datatype
Next
From: Bruce Momjian
Date:
Subject: I need a PostgreSQL vacation