Re: contrib/cube & contrib/seg regression fixes - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: contrib/cube & contrib/seg regression fixes
Date
Msg-id 200209230138.g8N1c7b16700@candle.pha.pa.us
Whole thread Raw
In response to Re: contrib/cube & contrib/seg regression fixes  (Joe Conway <mail@joeconway.com>)
List pgsql-patches
Patch applied by Tom.  Thanks.

---------------------------------------------------------------------------


Joe Conway wrote:
> Tom Lane wrote:
> > Joe Conway <mail@joeconway.com> writes:
> >>FWIW, both seg and cube have "#define YYERROR_VERBOSE", which seems to
> >>add the expected/unexpected text. It might solve the issue to remove
> >>the define and accept slightly less verbose output.
> >
> > That sounds like a plan to me; if the verbose output varies from one
> > bison version to another, then we should turn it off in the standard
> > build.  (Anyone who really wants it can turn it on again.)
> >
> > Any objections out there?
> >
>
> I haven't seen any objections, so here is a patch. It removes "#define
> YYERROR_VERBOSE" from contrib/cube and contrib/seg, and adjusts the expected
> output accordingly. Hopefully this will consistently pass across multiple
> bison versions.
>
> If no objections materialize, please apply.
>
> Thanks,
>
> Joe

> Index: contrib/cube/cubeparse.y
> ===================================================================
> RCS file: /opt/src/cvs/pgsql-server/contrib/cube/cubeparse.y,v
> retrieving revision 1.5
> diff -c -r1.5 cubeparse.y
> *** contrib/cube/cubeparse.y    12 Sep 2002 00:26:00 -0000    1.5
> --- contrib/cube/cubeparse.y    19 Sep 2002 04:32:18 -0000
> ***************
> *** 2,8 ****
>   /* NdBox = [(lowerleft),(upperright)] */
>   /* [(xLL(1)...xLL(N)),(xUR(1)...xUR(n))] */
>
> - #define YYERROR_VERBOSE
>   #define YYPARSE_PARAM result  /* need this to pass a pointer (void *) to yyparse */
>   #define YYSTYPE char *
>   #define YYDEBUG 1
> --- 2,7 ----
> Index: contrib/cube/expected/cube.out
> ===================================================================
> RCS file: /opt/src/cvs/pgsql-server/contrib/cube/expected/cube.out,v
> retrieving revision 1.5
> diff -c -r1.5 cube.out
> *** contrib/cube/expected/cube.out    12 Sep 2002 00:26:00 -0000    1.5
> --- contrib/cube/expected/cube.out    19 Sep 2002 04:33:04 -0000
> ***************
> *** 258,303 ****
>   SELECT ''::cube AS cube;
>   ERROR:  cube_in: can't parse an empty string
>   SELECT 'ABC'::cube AS cube;
> ! ERROR:  parse error, expecting `FLOAT' or `O_PAREN' or `O_BRACKET' at or before position 1, character ('A', \101),
input:'ABC' 
>
>   SELECT '()'::cube AS cube;
> ! ERROR:  parse error, expecting `FLOAT' at or before position 2, character (')', \051), input: '()'
>
>   SELECT '[]'::cube AS cube;
> ! ERROR:  parse error, expecting `O_PAREN' at or before position 2, character (']', \135), input: '[]'
>
>   SELECT '[()]'::cube AS cube;
> ! ERROR:  parse error, expecting `FLOAT' at or before position 3, character (')', \051), input: '[()]'
>
>   SELECT '[(1)]'::cube AS cube;
> ! ERROR:  parse error, expecting `COMMA' at or before position 5, character (']', \135), input: '[(1)]'
>
>   SELECT '[(1),]'::cube AS cube;
> ! ERROR:  parse error, expecting `O_PAREN' at or before position 6, character (']', \135), input: '[(1),]'
>
>   SELECT '[(1),2]'::cube AS cube;
> ! ERROR:  parse error, expecting `O_PAREN' at or before position 7, character (']', \135), input: '[(1),2]'
>
>   SELECT '[(1),(2),(3)]'::cube AS cube;
> ! ERROR:  parse error, expecting `C_BRACKET' at or before position 9, character (',', \054), input: '[(1),(2),(3)]'
>
>   SELECT '1,'::cube AS cube;
> ! ERROR:  parse error, expecting `FLOAT' at or before position 2, character (',', \054), input: '1,'
>
>   SELECT '1,2,'::cube AS cube;
> ! ERROR:  parse error, expecting `FLOAT' at or before position 4, character (',', \054), input: '1,2,'
>
>   SELECT '1,,2'::cube AS cube;
> ! ERROR:  parse error, expecting `FLOAT' at or before position 3, character (',', \054), input: '1,,2'
>
>   SELECT '(1,)'::cube AS cube;
> ! ERROR:  parse error, expecting `FLOAT' at or before position 4, character (')', \051), input: '(1,)'
>
>   SELECT '(1,2,)'::cube AS cube;
> ! ERROR:  parse error, expecting `FLOAT' at or before position 6, character (')', \051), input: '(1,2,)'
>
>   SELECT '(1,,2)'::cube AS cube;
> ! ERROR:  parse error, expecting `FLOAT' at or before position 4, character (',', \054), input: '(1,,2)'
>
>   -- invalid input: semantic errors and trailing garbage
>   SELECT '[(1),(2)],'::cube AS cube; -- 0
> --- 258,303 ----
>   SELECT ''::cube AS cube;
>   ERROR:  cube_in: can't parse an empty string
>   SELECT 'ABC'::cube AS cube;
> ! ERROR:  parse error at or before position 1, character ('A', \101), input: 'ABC'
>
>   SELECT '()'::cube AS cube;
> ! ERROR:  parse error at or before position 2, character (')', \051), input: '()'
>
>   SELECT '[]'::cube AS cube;
> ! ERROR:  parse error at or before position 2, character (']', \135), input: '[]'
>
>   SELECT '[()]'::cube AS cube;
> ! ERROR:  parse error at or before position 3, character (')', \051), input: '[()]'
>
>   SELECT '[(1)]'::cube AS cube;
> ! ERROR:  parse error at or before position 5, character (']', \135), input: '[(1)]'
>
>   SELECT '[(1),]'::cube AS cube;
> ! ERROR:  parse error at or before position 6, character (']', \135), input: '[(1),]'
>
>   SELECT '[(1),2]'::cube AS cube;
> ! ERROR:  parse error at or before position 7, character (']', \135), input: '[(1),2]'
>
>   SELECT '[(1),(2),(3)]'::cube AS cube;
> ! ERROR:  parse error at or before position 9, character (',', \054), input: '[(1),(2),(3)]'
>
>   SELECT '1,'::cube AS cube;
> ! ERROR:  parse error at or before position 2, character (',', \054), input: '1,'
>
>   SELECT '1,2,'::cube AS cube;
> ! ERROR:  parse error at or before position 4, character (',', \054), input: '1,2,'
>
>   SELECT '1,,2'::cube AS cube;
> ! ERROR:  parse error at or before position 3, character (',', \054), input: '1,,2'
>
>   SELECT '(1,)'::cube AS cube;
> ! ERROR:  parse error at or before position 4, character (')', \051), input: '(1,)'
>
>   SELECT '(1,2,)'::cube AS cube;
> ! ERROR:  parse error at or before position 6, character (')', \051), input: '(1,2,)'
>
>   SELECT '(1,,2)'::cube AS cube;
> ! ERROR:  parse error at or before position 4, character (',', \054), input: '(1,,2)'
>
>   -- invalid input: semantic errors and trailing garbage
>   SELECT '[(1),(2)],'::cube AS cube; -- 0
> Index: contrib/seg/segparse.y
> ===================================================================
> RCS file: /opt/src/cvs/pgsql-server/contrib/seg/segparse.y,v
> retrieving revision 1.4
> diff -c -r1.4 segparse.y
> *** contrib/seg/segparse.y    2 Sep 2002 06:11:42 -0000    1.4
> --- contrib/seg/segparse.y    19 Sep 2002 04:35:09 -0000
> ***************
> *** 1,5 ****
>   %{
> - #define YYERROR_VERBOSE
>   #define YYPARSE_PARAM result  /* need this to pass a pointer (void *) to yyparse */
>
>   #include "postgres.h"
> --- 1,4 ----
> Index: contrib/seg/expected/seg.out
> ===================================================================
> RCS file: /opt/src/cvs/pgsql-server/contrib/seg/expected/seg.out,v
> retrieving revision 1.2
> diff -c -r1.2 seg.out
> *** contrib/seg/expected/seg.out    23 Aug 2002 00:04:52 -0000    1.2
> --- contrib/seg/expected/seg.out    19 Sep 2002 04:35:42 -0000
> ***************
> *** 395,419 ****
>   SELECT ''::seg AS seg;
>   ERROR:  seg_in: can't parse an empty string
>   SELECT 'ABC'::seg AS seg;
> ! ERROR:  parse error, expecting `FLOAT' or `RANGE' or `EXTENSION' at or near position 1, character ('A', \101),
input:'ABC' 
>
>   SELECT '1ABC'::seg AS seg;
> ! ERROR:  expecting end of input at or near position 2, character ('A', \101), input: '1ABC'
>
>   SELECT '1.'::seg AS seg;
> ! ERROR:  expecting end of input at or near position 2, character ('.', \056), input: '1.'
>
>   SELECT '1.....'::seg AS seg;
> ! ERROR:  expecting end of input at or near position 6, character ('.', \056), input: '1.....'
>
>   SELECT '.1'::seg AS seg;
> ! ERROR:  parse error, expecting `FLOAT' or `RANGE' or `EXTENSION' at or near position 2, character ('1', \061),
input:'.1' 
>
>   SELECT '1..2.'::seg AS seg;
> ! ERROR:  expecting end of input at or near position 5, character ('.', \056), input: '1..2.'
>
>   SELECT '1 e7'::seg AS seg;
> ! ERROR:  expecting end of input at or near position 3, character ('e', \145), input: '1 e7'
>
>   SELECT '1e700'::seg AS seg;
>   ERROR:  numeric value 1e700 unrepresentable
> --- 395,419 ----
>   SELECT ''::seg AS seg;
>   ERROR:  seg_in: can't parse an empty string
>   SELECT 'ABC'::seg AS seg;
> ! ERROR:  parse error at or near position 1, character ('A', \101), input: 'ABC'
>
>   SELECT '1ABC'::seg AS seg;
> ! ERROR:  parse error at or near position 2, character ('A', \101), input: '1ABC'
>
>   SELECT '1.'::seg AS seg;
> ! ERROR:  parse error at or near position 2, character ('.', \056), input: '1.'
>
>   SELECT '1.....'::seg AS seg;
> ! ERROR:  parse error at or near position 6, character ('.', \056), input: '1.....'
>
>   SELECT '.1'::seg AS seg;
> ! ERROR:  parse error at or near position 2, character ('1', \061), input: '.1'
>
>   SELECT '1..2.'::seg AS seg;
> ! ERROR:  parse error at or near position 5, character ('.', \056), input: '1..2.'
>
>   SELECT '1 e7'::seg AS seg;
> ! ERROR:  parse error at or near position 3, character ('e', \145), input: '1 e7'
>
>   SELECT '1e700'::seg AS seg;
>   ERROR:  numeric value 1e700 unrepresentable

>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

--
  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

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] DROP COLUMN misbehaviour with multiple inheritance
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] [GENERAL] Memory Errors...