simple make check failures

Started by Jonathan Scottalmost 22 years ago10 messages
#1Jonathan Scott
jwscott@vanten.com
1 attachment(s)

This is my first post to the dev list, so please be gentle. ;)

When using the current head of pgsql, I find four errors when running "make check". They are all of the same nature, basically that the expected.out file has "syntax error", where as psql is saying "parse error".

I have included the cvs diff of the changes I made. Please feel free to let me know where I have gone wrong, or to tell me "thanks!" in the case I just happen to be on the right track. ;)

Jonathan Scott

--
Jonathan Scott, Programmer, Vanten K.K.
jwscott@vanten.com Tel: 03-5919-0266
http://www.vanten.com Fax: 03-5919-0267

Attachments:

pgsql.HEAD.cvs.diff.logapplication/octet-stream; name=pgsql.HEAD.cvs.diff.logDownload
Index: src/test/regress/expected/errors.out
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/test/regress/expected/errors.out,v
retrieving revision 1.47
diff -u -r1.47 errors.out
--- src/test/regress/expected/errors.out	25 Sep 2003 06:58:06 -0000	1.47
+++ src/test/regress/expected/errors.out	26 Feb 2004 02:51:42 -0000
@@ -22,13 +22,13 @@
  
 -- missing relation name 
 select;
-ERROR:  syntax error at or near ";" at character 7
+ERROR:  parse error at or near ";" at character 7
 -- no such relation 
 select * from nonesuch;
 ERROR:  relation "nonesuch" does not exist
 -- missing target list
 select from pg_database;
-ERROR:  syntax error at or near "from" at character 8
+ERROR:  parse error at or near "from" at character 8
 -- bad name in target list
 select nonesuch from pg_database;
 ERROR:  column "nonesuch" does not exist
@@ -40,7 +40,7 @@
 ERROR:  column "nonesuch" does not exist
 -- bad select distinct on syntax, distinct attribute missing
 select distinct on (foobar) from pg_database;
-ERROR:  syntax error at or near "from" at character 29
+ERROR:  parse error at or near "from" at character 29
 -- bad select distinct on syntax, distinct attribute not in target list
 select distinct on (foobar) * from pg_database;
 ERROR:  column "foobar" does not exist
@@ -49,7 +49,7 @@
  
 -- missing relation name (this had better not wildcard!) 
 delete from;
-ERROR:  syntax error at or near ";" at character 12
+ERROR:  parse error at or near ";" at character 12
 -- no such relation 
 delete from nonesuch;
 ERROR:  relation "nonesuch" does not exist
@@ -58,7 +58,7 @@
  
 -- missing relation name (this had better not wildcard!) 
 drop table;
-ERROR:  syntax error at or near ";" at character 11
+ERROR:  parse error at or near ";" at character 11
 -- no such relation 
 drop table nonesuch;
 ERROR:  table "nonesuch" does not exist
@@ -68,7 +68,7 @@
 -- relation renaming 
 -- missing relation name 
 alter table rename;
-ERROR:  syntax error at or near ";" at character 19
+ERROR:  parse error at or near ";" at character 19
 -- no such relation 
 alter table nonesuch rename to newnonesuch;
 ERROR:  relation "nonesuch" does not exist
@@ -122,10 +122,10 @@
  
 -- missing index name 
 drop index;
-ERROR:  syntax error at or near ";" at character 11
+ERROR:  parse error at or near ";" at character 11
 -- bad index name 
 drop index 314159;
-ERROR:  syntax error at or near "314159" at character 12
+ERROR:  parse error at or near "314159" at character 12
 -- no such index 
 drop index nonesuch;
 ERROR:  index "nonesuch" does not exist
@@ -134,13 +134,13 @@
  
 -- missing aggregate name 
 drop aggregate;
-ERROR:  syntax error at or near ";" at character 15
+ERROR:  parse error at or near ";" at character 15
 -- missing aggregate type
 drop aggregate newcnt1;
-ERROR:  syntax error at or near ";" at character 23
+ERROR:  parse error at or near ";" at character 23
 -- bad aggregate name 
 drop aggregate 314159 (int);
-ERROR:  syntax error at or near "314159" at character 16
+ERROR:  parse error at or near "314159" at character 16
 -- bad aggregate type
 drop aggregate newcnt (nonesuch);
 ERROR:  type "nonesuch" does not exist
@@ -155,10 +155,10 @@
  
 -- missing function name 
 drop function ();
-ERROR:  syntax error at or near "(" at character 15
+ERROR:  parse error at or near "(" at character 15
 -- bad function name 
 drop function 314159();
-ERROR:  syntax error at or near "314159" at character 15
+ERROR:  parse error at or near "314159" at character 15
 -- no such function 
 drop function nonesuch();
 ERROR:  function nonesuch() does not exist
@@ -167,10 +167,10 @@
  
 -- missing type name 
 drop type;
-ERROR:  syntax error at or near ";" at character 10
+ERROR:  parse error at or near ";" at character 10
 -- bad type name 
 drop type 314159;
-ERROR:  syntax error at or near "314159" at character 11
+ERROR:  parse error at or near "314159" at character 11
 -- no such type 
 drop type nonesuch;
 ERROR:  type "nonesuch" does not exist
@@ -179,22 +179,22 @@
  
 -- missing everything 
 drop operator;
-ERROR:  syntax error at or near ";" at character 14
+ERROR:  parse error at or near ";" at character 14
 -- bad operator name 
 drop operator equals;
-ERROR:  syntax error at or near ";" at character 21
+ERROR:  parse error at or near ";" at character 21
 -- missing type list 
 drop operator ===;
-ERROR:  syntax error at or near ";" at character 18
+ERROR:  parse error at or near ";" at character 18
 -- missing parentheses 
 drop operator int4, int4;
-ERROR:  syntax error at or near "," at character 19
+ERROR:  parse error at or near "," at character 19
 -- missing operator name 
 drop operator (int4, int4);
-ERROR:  syntax error at or near "(" at character 15
+ERROR:  parse error at or near "(" at character 15
 -- missing type list contents 
 drop operator === ();
-ERROR:  syntax error at or near ")" at character 20
+ERROR:  parse error at or near ")" at character 20
 -- no such operator 
 drop operator === (int4);
 ERROR:  missing argument
@@ -208,7 +208,7 @@
 HINT:  Use NONE to denote the missing argument of a unary operator.
 -- no such type1 
 drop operator = ( , int4);
-ERROR:  syntax error at or near "," at character 19
+ERROR:  parse error at or near "," at character 19
 -- no such type1 
 drop operator = (nonesuch, int4);
 ERROR:  type nonesuch does not exist
@@ -217,28 +217,28 @@
 ERROR:  type nonesuch does not exist
 -- no such type2 
 drop operator = (int4, );
-ERROR:  syntax error at or near ")" at character 24
+ERROR:  parse error at or near ")" at character 24
 --
 -- DROP RULE
  
 -- missing rule name 
 drop rule;
-ERROR:  syntax error at or near ";" at character 10
+ERROR:  parse error at or near ";" at character 10
 -- bad rule name 
 drop rule 314159;
-ERROR:  syntax error at or near "314159" at character 11
+ERROR:  parse error at or near "314159" at character 11
 -- no such rule 
 drop rule nonesuch on noplace;
 ERROR:  relation "noplace" does not exist
 -- bad keyword 
 drop tuple rule nonesuch;
-ERROR:  syntax error at or near "tuple" at character 6
+ERROR:  parse error at or near "tuple" at character 6
 -- no such rule 
 drop instance rule nonesuch on noplace;
-ERROR:  syntax error at or near "instance" at character 6
+ERROR:  parse error at or near "instance" at character 6
 -- no such rule 
 drop rewrite rule nonesuch;
-ERROR:  syntax error at or near "rewrite" at character 6
+ERROR:  parse error at or near "rewrite" at character 6
 --
 -- Check that division-by-zero is properly caught.
 --
Index: src/test/regress/expected/strings.out
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/test/regress/expected/strings.out,v
retrieving revision 1.23
diff -u -r1.23 strings.out
--- src/test/regress/expected/strings.out	27 Jul 2003 04:53:11 -0000	1.23
+++ src/test/regress/expected/strings.out	26 Feb 2004 02:51:44 -0000
@@ -18,7 +18,7 @@
 ' - next line' /* this comment is not allowed here */
 ' - third line'
 	AS "Illegal comment within continuation";
-ERROR:  syntax error at or near "' - third line'" at character 75
+ERROR:  parse error at or near "' - third line'" at character 75
 --
 -- test conversions between various string types
 -- E021-10 implicit casting among the character data types
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Jonathan Scott (#1)
Re: simple make check failures

Jonathan Scott <jwscott@vanten.com> writes:

When using the current head of pgsql, I find four errors when running "make check". They are all of the same nature, basically that the expected.out file has "syntax error", where as psql is saying "parse error".

What bison version are you using? That was a bison change a few revs
back.

I'm actually surprised that CVS tip builds at all with a bison that
predates that change. We are stressing bison because the grammar
is so large. You really need bison 1.875 or later. (I think configure
will warn about it if your bison is older, but the warning is easy to
miss in the voluminous configure chatter :-()

regards, tom lane

#3Jonathan Scott
jwscott@vanten.com
In reply to: Tom Lane (#2)
Re: simple make check failures

Thanks for writing, Tom.

I checked my system, and bison is reporting itself as 1.875. I am using SuSE 9.0, and I did have to upgrade to get that configuration message to go away, AND to make it compile.

Could you recommend a way I could get bison to reproduce that message? Perhaps I should recompile bison from source, so it does not do any kind of backward compatibility stuff? (if you are in fact suggesting that is what the old bison reported)

Jonathan Scott

On Thu, 26 Feb 2004 00:17:14 -0500
Tom Lane <tgl@sss.pgh.pa.us> wrote:

Jonathan Scott <jwscott@vanten.com> writes:

When using the current head of pgsql, I find four errors when running "make check". They are all of the same nature, basically that the expected.out file has "syntax error", where as psql is saying "parse error".

What bison version are you using? That was a bison change a few revs
back.

I'm actually surprised that CVS tip builds at all with a bison that
predates that change. We are stressing bison because the grammar
is so large. You really need bison 1.875 or later. (I think configure
will warn about it if your bison is older, but the warning is easy to
miss in the voluminous configure chatter :-()

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

--
Jonathan Scott, Programmer, Vanten K.K.
jwscott@vanten.com Tel: 03-5919-0266
http://www.vanten.com Fax: 03-5919-0267

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Jonathan Scott (#3)
Re: simple make check failures

Jonathan Scott <jwscott@vanten.com> writes:

I checked my system, and bison is reporting itself as 1.875. I am using SuSE 9.0, and I did have to upgrade to get that configuration message to go away, AND to make it compile.

Could you recommend a way I could get bison to reproduce that message?

If you did just upgrade bison, I'd suggest "make maintainer-clean" and
then rebuild. I do not think the Postgres makefiles are able to detect
that you installed a new bison, so they won't automatically re-run bison
to build new output files. We normally ship the bison output files as
part of distribution tarballs, which is why "make clean" or even "make
distclean" doesn't flush 'em.

regards, tom lane

#5Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Tom Lane (#4)
Re: simple make check failures

Tom Lane wrote:

Jonathan Scott <jwscott@vanten.com> writes:

I checked my system, and bison is reporting itself as 1.875. I am using SuSE 9.0, and I did have to upgrade to get that configuration message to go away, AND to make it compile.

Could you recommend a way I could get bison to reproduce that message?

If you did just upgrade bison, I'd suggest "make maintainer-clean" and
then rebuild. I do not think the Postgres makefiles are able to detect
that you installed a new bison, so they won't automatically re-run bison
to build new output files. We normally ship the bison output files as
part of distribution tarballs, which is why "make clean" or even "make
distclean" doesn't flush 'em.

I have updated the text warning about too-old bison to be clearer when
it is a problem:

! *** If you are going to modify the lexer files or build from CVS, the installed
! *** version of Bison is too old. Bison version 1.875 or later is required.])

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#6Peter Eisentraut
peter_e@gmx.net
In reply to: Bruce Momjian (#5)
Re: simple make check failures

Bruce Momjian wrote:

! *** If you are going to modify the lexer files or build from CVS,
the installed ! *** version of Bison is too old. Bison version 1.875
or later is required.])

Bison has nothing to do with the lexer files.

#7Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Peter Eisentraut (#6)
Re: simple make check failures

Peter Eisentraut wrote:

Bruce Momjian wrote:

! *** If you are going to modify the lexer files or build from CVS,
the installed ! *** version of Bison is too old. Bison version 1.875
or later is required.])

Bison has nothing to do with the lexer files.

Oops, sorry, new text:

*** If you are going to modify the grammar files or build from CVS, the installed
*** version of Bison is too old. Bison version 1.875 or later is required.])

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#8Cyril VELTER
cyril.velter@metadys.com
In reply to: Bruce Momjian (#7)
Prepared queries and portals

While adapting an application to make use of the new protocol, I've
faced one problem. I cannot execute a prepared query and fetch the result in
several time. The multiple fetch is accessible with cursor in SQL but I
haven't found any way to execute a prepared query in a cursor.

The documentation clearly state that the protocol support this beahvior,
so I've modified libpq to handle the case by adding to functions :

PQexecPreparedPortal(conn,stmtName,portalName,nParams,paramValues,paramlengt
h,paramFormats,resultFormat,maxrows);

and

PQfetchPortal(conn,portalName,maxrows)

PQexecPreparedPortal is a PQexecPrepared clone but you can specify the
portal in which the result should be put (which might be the unnamed one)
and the maximum number of rows to retreive after the execution.

PQfetchPortal fetch the next rows.

This works nicely. I would like to see this included in the standard
libpq, and will submit a patch if this might be usefull, but as it extend
the libpq API there might be more general plan to support the functionality.

Any comments ?

cyril

#9Tom Lane
tgl@sss.pgh.pa.us
In reply to: Cyril VELTER (#8)
Re: Prepared queries and portals

"Cyril VELTER" <cyril.velter@metadys.com> writes:

so I've modified libpq to handle the case by adding to functions :

PQexecPreparedPortal(conn,stmtName,portalName,nParams,paramValues,paramlengt
h,paramFormats,resultFormat,maxrows);

and

PQfetchPortal(conn,portalName,maxrows)

PQexecPreparedPortal is a PQexecPrepared clone but you can specify the
portal in which the result should be put (which might be the unnamed one)
and the maximum number of rows to retreive after the execution.

PQfetchPortal fetch the next rows.

This works nicely.

This looks fairly messy to me. Seems like the exposed API ought to be
three functions: set up a portal, fetch (up to) N rows from a portal,
close down a portal. Your proposal confuses the first two and fails to
provide the last.

More generally it might be a good idea to provide lower-level access to
other parts of the extended-query protocol, such as Describe and Sync.
I did not do anything about that in 7.4 for lack of time, but it's still
something that ought to be thought about.

regards, tom lane

#10Cyril VELTER
cyril.velter@metadys.com
In reply to: Bruce Momjian (#7)
Re: Prepared queries and portals

"Tom Lane" <tgl@sss.pgh.pa.us> writes:

"Cyril VELTER" <cyril.velter@metadys.com> writes:

so I've modified libpq to handle the case by adding to functions :

PQexecPreparedPortal(conn,stmtName,portalName,nParams,paramValues,paramlengt

h,paramFormats,resultFormat,maxrows);

and

PQfetchPortal(conn,portalName,maxrows)

PQexecPreparedPortal is a PQexecPrepared clone but you can specify

the

portal in which the result should be put (which might be the unnamed

one)

and the maximum number of rows to retreive after the execution.

PQfetchPortal fetch the next rows.

This works nicely.

This looks fairly messy to me. Seems like the exposed API ought to be
three functions: set up a portal, fetch (up to) N rows from a portal,
close down a portal. Your proposal confuses the first two and fails to
provide the last.

What do you think of :

PQportalSetup(conn,stmtName,portalName,nParams,paramValues,paramlength,param
Formats,resultFormat);

Setup a portal (might be the unnamed one) base on a prepared statement.
return an empty resultset.

PQportalFetch(conn,portalName,maxrows);

Fetch rows from the portal. Return a resultset (empty when finished)

PQportalClose(conn,portalName);

Close the portal, return an empty resultset.

More generally it might be a good idea to provide lower-level access to
other parts of the extended-query protocol, such as Describe and Sync.
I did not do anything about that in 7.4 for lack of time, but it's still
something that ought to be thought about.

Would be nice. One thing that is missing today is the ability to specify
differents format (text/binary) for each columns. Binary bindings are very
nice (performance wise) for bytea and simple datatypes (int/float), but are
not very easy to deal with for complex ones (numeric come to mind). Speaking
of the numeric datatype, does the binary representation can be considered
stable or is it something that will change from version to version ?

Do you think that adding the previous three intermediate-level calls
might be usefull ?

Cyril