Thread: fix broken regression tests

fix broken regression tests

From
Neil Conway
Date:
4 of the regression tests are presently broken, due to a trivial change
in the wording of a "syntax error" error message. This patch fixes them.

Cheers,

Neil
--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC



Attachment

Re: fix broken regression tests

From
Tom Lane
Date:
Neil Conway <neilc@samurai.com> writes:
> 4 of the regression tests are presently broken, due to a trivial change
> in the wording of a "syntax error" error message. This patch fixes them.

There's more to this than meets the eye, as I see no such breakage here.

I have a nasty feeling that you recently updated your bison, and the
bison people saw fit to change the message wording?  If so, we have an
unpleasant bison-version-dependency issue here.

            regards, tom lane

Re: fix broken regression tests

From
Bruce Momjian
Date:
FYI, I am now running nightly build tests that run compile, initdb, and
regression, and report any compile warning too, so I can know sooner
when something is broken.

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

Neil Conway wrote:
> 4 of the regression tests are presently broken, due to a trivial change
> in the wording of a "syntax error" error message. This patch fixes them.
>
> Cheers,
>
> Neil
> --
> Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC
>
>

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html

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

Re: fix broken regression tests

From
Neil Conway
Date:
On Mon, 2003-01-13 at 14:44, Tom Lane wrote:
> I have a nasty feeling that you recently updated your bison, and the
> bison people saw fit to change the message wording?

Looks like it to me: I hadn't noticed, but Debian unstable recently
upgraded to bison 1.875 -- when I downgraded to 1.75 again, the
regression tests now pass without any problems.

Cheers,

Neil
--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC




Re: fix broken regression tests

From
Tom Lane
Date:
Neil Conway <neilc@samurai.com> writes:
> On Mon, 2003-01-13 at 14:44, Tom Lane wrote:
>> I have a nasty feeling that you recently updated your bison, and the
>> bison people saw fit to change the message wording?

> Looks like it to me: I hadn't noticed, but Debian unstable recently
> upgraded to bison 1.875 -- when I downgraded to 1.75 again, the
> regression tests now pass without any problems.

Ugh, that's bad news.  Can we lobby the bison folks to revert this
random rewording of an error message?  Or at least make it configurable,
so that we can avoid exposing any change to our users?

            regards, tom lane

Re: fix broken regression tests

From
Bruce Momjian
Date:
Tom Lane wrote:
> Neil Conway <neilc@samurai.com> writes:
> > On Mon, 2003-01-13 at 14:44, Tom Lane wrote:
> >> I have a nasty feeling that you recently updated your bison, and the
> >> bison people saw fit to change the message wording?
>
> > Looks like it to me: I hadn't noticed, but Debian unstable recently
> > upgraded to bison 1.875 -- when I downgraded to 1.75 again, the
> > regression tests now pass without any problems.
>
> Ugh, that's bad news.  Can we lobby the bison folks to revert this
> random rewording of an error message?  Or at least make it configurable,
> so that we can avoid exposing any change to our users?

How many folks compile using bison?   Only the CVS folks, right?  One
idea would be to mask the change in the regression diff processing.

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

Re: fix broken regression tests

From
Tom Lane
Date:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> How many folks compile using bison?   Only the CVS folks, right?  One
> idea would be to mask the change in the regression diff processing.

And you will mask it from our clients the same way?  The regression
tests are not the only things that are looking for that string.

The bison folk have already cost us one flag day in the recent past.
I don't propose to lay down quietly while they cost us another one for
no better reason than that somebody decided "syntax error" read better
than what they had used for the last umpteen years.

            regards, tom lane

Re: fix broken regression tests

From
Bruce Momjian
Date:
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > How many folks compile using bison?   Only the CVS folks, right?  One
> > idea would be to mask the change in the regression diff processing.
>
> And you will mask it from our clients the same way?  The regression
> tests are not the only things that are looking for that string.
>
> The bison folk have already cost us one flag day in the recent past.
> I don't propose to lay down quietly while they cost us another one for
> no better reason than that somebody decided "syntax error" read better
> than what they had used for the last umpteen years.

I am just saying if we can't get it reverted, that will be our fallback.
Also, they have to release the reverted version soon or there will be
enough different bisons around that we will have to workaround it
anyway.

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

Re: fix broken regression tests

From
Tom Lane
Date:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Tom Lane wrote:
>> The bison folk have already cost us one flag day in the recent past.
>> I don't propose to lay down quietly while they cost us another one for
>> no better reason than that somebody decided "syntax error" read better
>> than what they had used for the last umpteen years.

> I am just saying if we can't get it reverted, that will be our fallback.

Actually, the fallback I'm thinking about is
    sed 's/syntax error/parse error/'
in the build rule for gram.c ...

            regards, tom lane

Re: fix broken regression tests

From
Gavin Sherry
Date:
On Wed, 15 Jan 2003, Tom Lane wrote:

> Neil Conway <neilc@samurai.com> writes:
> > On Mon, 2003-01-13 at 14:44, Tom Lane wrote:
> >> I have a nasty feeling that you recently updated your bison, and the
> >> bison people saw fit to change the message wording?
>
> > Looks like it to me: I hadn't noticed, but Debian unstable recently
> > upgraded to bison 1.875 -- when I downgraded to 1.75 again, the
> > regression tests now pass without any problems.
>
> Ugh, that's bad news.  Can we lobby the bison folks to revert this
> random rewording of an error message?  Or at least make it configurable,
> so that we can avoid exposing any change to our users?

The change doesn't seem to be for trivial reasons. Log message for
revision 1.35 of data/yacc.c says:

"parse error" -> "syntax error" for POSIX compatibility.

Gavin


Re: fix broken regression tests

From
"Christopher Kings-Lynne"
Date:
> The change doesn't seem to be for trivial reasons. Log message for
> revision 1.35 of data/yacc.c says:
>
> "parse error" -> "syntax error" for POSIX compatibility.

Surely we can just override their message with out own?

Chris


Re: fix broken regression tests

From
Tom Lane
Date:
Gavin Sherry <swm@linuxworld.com.au> writes:
> On Wed, 15 Jan 2003, Tom Lane wrote:
>> Ugh, that's bad news.  Can we lobby the bison folks to revert this
>> random rewording of an error message?  Or at least make it configurable,
>> so that we can avoid exposing any change to our users?

> The change doesn't seem to be for trivial reasons. Log message for
> revision 1.35 of data/yacc.c says:
> "parse error" -> "syntax error" for POSIX compatibility.

Grumble.  That probably means they'll reject any complaints about it.

My inclination at this point is to do sed 's/syntax error/parse error/'
in our grammar build rules so as to maintain backwards compatibility.

Plan B would be to go the other way --- sed 's/parse error/syntax error/'
--- so as to get consistent results from all post-1.50 Bisons.  However
I am concerned that this will needlessly break client-side code.
(If you grep for 'parse error' in our sources you will find it a lot
more places than just the regression tests Neil originally fingered;
and that's not even counting the code that now lives on gborg.)

Comments?

            regards, tom lane

Re: fix broken regression tests

From
Gavin Sherry
Date:
On Wed, 15 Jan 2003, Tom Lane wrote:

> Gavin Sherry <swm@linuxworld.com.au> writes:
> > On Wed, 15 Jan 2003, Tom Lane wrote:
> >> Ugh, that's bad news.  Can we lobby the bison folks to revert this
> >> random rewording of an error message?  Or at least make it configurable,
> >> so that we can avoid exposing any change to our users?
>
> > The change doesn't seem to be for trivial reasons. Log message for
> > revision 1.35 of data/yacc.c says:
> > "parse error" -> "syntax error" for POSIX compatibility.
>
> Grumble.  That probably means they'll reject any complaints about it.

Yep. That's why I brought it up.

>
> My inclination at this point is to do sed 's/syntax error/parse error/'
> in our grammar build rules so as to maintain backwards compatibility.

How about we do that for 7.4 with a mention in the release notes / manual
that 'syntax error' will release 'parse error' in some future
release. Then again, isn't their a planned overhaul of error handling
for 7.4 to bring it into line with SQL? If so, a change to parse error
messages is the smallest problem facing users.

Gavin


Re: fix broken regression tests

From
"Christopher Kings-Lynne"
Date:
> Plan B would be to go the other way --- sed 's/parse error/syntax error/'
> --- so as to get consistent results from all post-1.50 Bisons.  However
> I am concerned that this will needlessly break client-side code.
> (If you grep for 'parse error' in our sources you will find it a lot
> more places than just the regression tests Neil originally fingered;
> and that's not even counting the code that now lives on gborg.)

We've given people enough backwards-compatibility pain for one lifetime -
keep it as parse error...

Chris


Re: fix broken regression tests

From
Tom Lane
Date:
Gavin Sherry <swm@linuxworld.com.au> writes:
> On Wed, 15 Jan 2003, Tom Lane wrote:
>> My inclination at this point is to do sed 's/syntax error/parse error/'
>> in our grammar build rules so as to maintain backwards compatibility.

> How about we do that for 7.4 with a mention in the release notes / manual
> that 'syntax error' will release 'parse error' in some future
> release. Then again, isn't their a planned overhaul of error handling
> for 7.4 to bring it into line with SQL? If so, a change to parse error
> messages is the smallest problem facing users.

Yeah, but it's only planned not definite (and so far, no one's stepped
up to bat to make it happen).  What was in the back of my mind was to
switch the sed args to align with newer Bisons at the time we actually
start making major changes to the error return protocol.  I'd prefer to
stick users with a big change later rather than a small change now
*and* a big change later.

            regards, tom lane

Re: fix broken regression tests

From
Tom Lane
Date:
Neil Conway <neilc@samurai.com> writes:
> 4 of the regression tests are presently broken, due to a trivial change
> in the wording of a "syntax error" error message. This patch fixes them.

Per subsequent discussion, I have instead hacked the Make rules to
replace "syntax error" by "parse error" in bison output files.  This
should allow us to work with bison 1.75 and later without variations
of output messages.  Regression tests pass for me with bison 1.875.

            regards, tom lane