Re: [Fwd: [PORTS] Port Bug Report: parse error not detected on unterminated quote] - Mailing list pgsql-ports

From Bruce Momjian
Subject Re: [Fwd: [PORTS] Port Bug Report: parse error not detected on unterminated quote]
Date
Msg-id 199907010443.AAA23367@candle.pha.pa.us
Whole thread Raw
In response to [Fwd: [PORTS] Port Bug Report: parse error not detected on unterminated quote]  (Thomas Lockhart <lockhart@alumni.caltech.edu>)
List pgsql-ports
> (back on list)
>
> Bruce, the problem is revealed with the "single-line input" mode of
> psql. I'm a bit suprised that the backend parser doesn't catch this,
> but I see why now: scan.l goes into a "string accumulate" mode when it
> sees a single quote, and doesn't actually send a token back to gram.y
> until it sees the closing quote. If EOT comes first, then there is no
> flag to tell gram.y (or whatever is the right thing) that there is
> still an active token being worked on.
>
> Not certain yet how to fix this; the "string accumulator" is currently
> local to scan.l and I'm not sure if scan.l can provide code to check
> this after it runs out of characters to process. I do have a lex/yacc
> book, but if anyone has some hints...

I seem to remember there is a function you can define to be called on
EOF in scan.l.

--
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

pgsql-ports by date:

Previous
From: PostgreSQL
Date:
Subject: PostgreSQL 6.5 on Irix 6.2
Next
From: Robert Bruccoleri
Date:
Subject: PostgreSQL on Irix