Re: ecpg - GRANT bug

From: Bill Studenmund <wrstuden(at)netbsd(dot)org>
To: Lee Kindness <lkindness(at)csl(dot)co(dot)uk>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <pgsql-hackers(at)postgresql(dot)org>, Michael Meskes <meskes(at)postgresql(dot)org>
Subject: Re: ecpg - GRANT bug
Date: 2001-10-15 12:15:13
Message-ID: Pine.NEB.4.33.0110150506170.22955-100000@vespasia.home-net.internetconnect.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Tue, 16 Oct 2001, Lee Kindness wrote:

> And the patch below corrects a pet peeve I have with ecpg, all errors
> and warnings are output with a line number one less than reality...

I think this patch is wrong. Wouldn't it be better to make the line number
in yylineno be correct? Also, there are users of the line number in pcg.l
which you didn't change.

Looking at it, I don't see why the line number is off. It is initialized
to 1 at the begining and whenever a new file is included. In the generated
code, it is incrimented whenever a '\n' is found. Strange...

Take care,

Bill

> Lee.
>
> *** ./interfaces/ecpg/preproc/preproc.y.orig Tue Oct 16 10:19:27 2001
> --- ./interfaces/ecpg/preproc/preproc.y Tue Oct 16 10:19:49 2001
> ***************
> *** 36,49 ****
> switch(type)
> {
> case ET_NOTICE:
> ! fprintf(stderr, "%s:%d: WARNING: %s\n", input_filename, yylineno, error);
> break;
> case ET_ERROR:
> ! fprintf(stderr, "%s:%d: ERROR: %s\n", input_filename, yylineno, error);
> ret_value = PARSE_ERROR;
> break;
> case ET_FATAL:
> ! fprintf(stderr, "%s:%d: ERROR: %s\n", input_filename, yylineno, error);
> exit(PARSE_ERROR);
> }
> }
> --- 36,52 ----
> switch(type)
> {
> case ET_NOTICE:
> ! fprintf(stderr, "%s:%d: WARNING: %s\n", input_filename,
> ! yylineno + 1, error);
> break;
> case ET_ERROR:
> ! fprintf(stderr, "%s:%d: ERROR: %s\n", input_filename,
> ! yylineno + 1, error);
> ret_value = PARSE_ERROR;
> break;
> case ET_FATAL:
> ! fprintf(stderr, "%s:%d: ERROR: %s\n", input_filename,
> ! yylineno + 1, error);
> exit(PARSE_ERROR);
> }
> }
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2001-10-15 14:10:40 Re: ecpg - GRANT bug
Previous Message Mika Mantyla 2001-10-15 09:50:54 Re: [BUGS] SQLPutData bug ?

Browse pgsql-hackers by date

  From Date Subject
Next Message Teodor Sigaev 2001-10-15 12:34:28 Re: New contrib/tsearch module for 7.2
Previous Message Vince Vielhaber 2001-10-15 10:39:57 Re: http link to ftp download area broken