Re: [BUGS] Minor irritant with comment parsing in a function (SQL) body

2003-10-09 Thread Bruce Momjian
Peter has fixed this in CVS. Thanks for the report. --- Richard Huxton wrote: > Versions: 7.3, 7.4beta (not latest) > Applies to SQL functions, but not apparently to plpgsql (because of the > different parser, I presume).

Re: [BUGS] Minor irritant with comment parsing in a function (SQL)

2003-10-08 Thread Peter Eisentraut
Tom Lane writes: > I think the minimum-damage place to fix this is by requiring \n after > {comment} in the horiz_whitespace rule. As is, it's possible for > xqcat to match to a second quote that is in the body of a -- comment. You mean like this? horiz_whitespace({horiz_space}|{comment

Re: [BUGS] Minor irritant with comment parsing in a function (SQL)

2003-10-08 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: > The bug here is that the scanner doesn't know that a newline (or end of > input) is a required as part of a -- comment. I think the minimum-damage place to fix this is by requiring \n after {comment} in the horiz_whitespace rule. As is, it's possible

Re: [BUGS] Minor irritant with comment parsing in a function (SQL)

2003-10-08 Thread Richard Huxton
On Wednesday 08 October 2003 20:56, Peter Eisentraut wrote: > Richard Huxton writes: > > CREATE OR REPLACE FUNCTION zzz_test () RETURNS text AS ' > > SELECT ''hello world'' > > -- SELECT ''goodbye world'' > > > > ::text; > > > > ' LANGUAGE 'SQL'; > > > > ERROR: parser: unterminated quoted string

Re: [BUGS] Minor irritant with comment parsing in a function (SQL)

2003-10-08 Thread Peter Eisentraut
Richard Huxton writes: > CREATE OR REPLACE FUNCTION zzz_test () RETURNS text AS ' > SELECT ''hello world'' > -- SELECT ''goodbye world'' > ::text; > ' LANGUAGE 'SQL'; > > ERROR: parser: unterminated quoted string at or near "'hello world' > -- SELECT 'goodbye world' > ::text; That's a good one

[BUGS] Minor irritant with comment parsing in a function (SQL) body

2003-10-08 Thread Richard Huxton
Versions: 7.3, 7.4beta (not latest) Applies to SQL functions, but not apparently to plpgsql (because of the different parser, I presume). This is really a "doctor it hurts when I..." thing - the fact that I've never come across it before must mean it's pretty hard to trigger. The first version