Tom Lane wrote:
> Joe Conway <mail@joeconway.com> writes:
>
>>I did find that contrib/cube fails `make installcheck` due to the bison
>>error message wording change (...syntax error... vs ... parse error
>>...). It seems contrib/seg was adjusted for this, but cube was not. Is
>>there a reason for that, or should I send in a patch?
>
> Since we are going to be going through substantial error message wording
> changes anyway for 7.4, I'm planning to revert the build-time hack that
> preserves the older bison spelling of the error message; we may as
> well standardize on the bison 1.875 spelling. So contrib/seg needs its
> hack undone, and both need their expected files updated. If you wanna
> do that, fine, otherwise I'll get to it when I start doing the backend
> error call updates.
OK -- patch attached. Both cube and seg pass `make installcheck` for me now.
Joe
Index: contrib/cube/Makefile
===================================================================
RCS file: /opt/src/cvs/pgsql-server/contrib/cube/Makefile,v
retrieving revision 1.8
diff -c -r1.8 Makefile
*** contrib/cube/Makefile 31 Jan 2003 20:58:00 -0000 1.8
--- contrib/cube/Makefile 4 May 2003 06:07:16 -0000
***************
*** 17,33 ****
cubeparse.c: cubeparse.h ;
- # The sed hack is so that we can get the same error messages with
- # bison 1.875 and later as we did with earlier bisons. Eventually,
- # I suppose, we should re-standardize on "syntax error" --- in which
- # case flip the sed translation, but don't remove it.
-
cubeparse.h: cubeparse.y
ifdef YACC
$(YACC) -d $(YFLAGS) -p cube_yy $<
! sed -e 's/"syntax error/"parse error/' < y.tab.c > cubeparse.c
mv -f y.tab.h cubeparse.h
- rm -f y.tab.c
else
@$(missing) bison $< $@
endif
--- 17,27 ----
cubeparse.c: cubeparse.h ;
cubeparse.h: cubeparse.y
ifdef YACC
$(YACC) -d $(YFLAGS) -p cube_yy $<
! mv -f y.tab.c cubeparse.c
mv -f y.tab.h cubeparse.h
else
@$(missing) bison $< $@
endif
Index: contrib/cube/expected/cube.out
===================================================================
RCS file: /opt/src/cvs/pgsql-server/contrib/cube/expected/cube.out,v
retrieving revision 1.10
diff -c -r1.10 cube.out
*** contrib/cube/expected/cube.out 13 Feb 2003 05:26:50 -0000 1.10
--- contrib/cube/expected/cube.out 4 May 2003 06:09:17 -0000
***************
*** 258,303 ****
SELECT ''::cube AS cube;
ERROR: cube_in: can't parse an empty string
SELECT 'ABC'::cube AS cube;
! ERROR: syntax error at or before position 1, character ('A', \101), input: 'ABC'
SELECT '()'::cube AS cube;
! ERROR: syntax error at or before position 2, character (')', \051), input: '()'
SELECT '[]'::cube AS cube;
! ERROR: syntax error at or before position 2, character (']', \135), input: '[]'
SELECT '[()]'::cube AS cube;
! ERROR: syntax error at or before position 3, character (')', \051), input: '[()]'
SELECT '[(1)]'::cube AS cube;
! ERROR: syntax error at or before position 5, character (']', \135), input: '[(1)]'
SELECT '[(1),]'::cube AS cube;
! ERROR: syntax error at or before position 6, character (']', \135), input: '[(1),]'
SELECT '[(1),2]'::cube AS cube;
! ERROR: syntax error at or before position 7, character (']', \135), input: '[(1),2]'
SELECT '[(1),(2),(3)]'::cube AS cube;
! ERROR: syntax error at or before position 9, character (',', \054), input: '[(1),(2),(3)]'
SELECT '1,'::cube AS cube;
! ERROR: syntax error at or before position 2, character (',', \054), input: '1,'
SELECT '1,2,'::cube AS cube;
! ERROR: syntax error at or before position 4, character (',', \054), input: '1,2,'
SELECT '1,,2'::cube AS cube;
! ERROR: syntax error at or before position 3, character (',', \054), input: '1,,2'
SELECT '(1,)'::cube AS cube;
! ERROR: syntax error at or before position 4, character (')', \051), input: '(1,)'
SELECT '(1,2,)'::cube AS cube;
! ERROR: syntax error at or before position 6, character (')', \051), input: '(1,2,)'
SELECT '(1,,2)'::cube AS cube;
! ERROR: syntax 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
--- 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/Makefile
===================================================================
RCS file: /opt/src/cvs/pgsql-server/contrib/seg/Makefile,v
retrieving revision 1.8
diff -c -r1.8 Makefile
*** contrib/seg/Makefile 31 Jan 2003 20:58:00 -0000 1.8
--- contrib/seg/Makefile 4 May 2003 06:07:35 -0000
***************
*** 16,32 ****
segparse.c: segparse.h ;
- # The sed hack is so that we can get the same error messages with
- # bison 1.875 and later as we did with earlier bisons. Eventually,
- # I suppose, we should re-standardize on "syntax error" --- in which
- # case flip the sed translation, but don't remove it.
-
segparse.h: segparse.y
ifdef YACC
$(YACC) -d $(YFLAGS) -p seg_yy $<
! sed -e 's/"syntax error/"parse error/' < y.tab.c > segparse.c
mv -f y.tab.h segparse.h
- rm -f y.tab.c
else
@$(missing) bison $< $@
endif
--- 16,26 ----
segparse.c: segparse.h ;
segparse.h: segparse.y
ifdef YACC
$(YACC) -d $(YFLAGS) -p seg_yy $<
! mv -f y.tab.c segparse.c
mv -f y.tab.h segparse.h
else
@$(missing) bison $< $@
endif