Thread: pgc.l modif. has been overwritten again

pgc.l modif. has been overwritten again

From
"Nicolas Bazin"
Date:
We need a little bit of order when several people can commit on the source code, It would be nice that they update their local copy and then commit, or check the directory or check for conflicts. 
It's the second time that this modif has been overwritten. It's getting anoying.
 
 
The patch corrects a test on defines end of visibility that is performed too early by the preprocessor.
 
Here it is again.
 
*** pgc.l Wed Mar 27 15:52:45 2002
--- cvs/src/interfaces/ecpg/preproc/pgc.l Fri Feb 15 17:46:57 2002
***************
*** 859,866 ****
     }
 
  <<EOF>>   {
-
-      if (yy_buffer == NULL) {
        if ( preproc_tos > 0 ) {
           preproc_tos = 0;
 
--- 859,864 ----
     }
 
  <<EOF>>   {
       if ( preproc_tos > 0 ) {
           preproc_tos = 0;
 
***************
*** 866,871 ****
 
           mmerror(PARSE_ERROR, ET_FATAL, "Missing 'EXEC SQL ENDIF;'");
        }
       yyterminate();
      }
       else
--- 864,871 ----
 
           mmerror(PARSE_ERROR, ET_FATAL, "Missing 'EXEC SQL ENDIF;'");
       }
+
+      if (yy_buffer == NULL)
      yyterminate();
       else
       {
***************
*** 867,873 ****
           mmerror(PARSE_ERROR, ET_FATAL, "Missing 'EXEC SQL ENDIF;'");
        }
       yyterminate();
-     }
       else
       {
      struct _yy_buffer *yb = yy_buffer;
--- 867,872 ----
 
       if (yy_buffer == NULL)
      yyterminate();
       else
       {
      struct _yy_buffer *yb = yy_buffer;
 
 
Nicolas.

Re: pgc.l modif. has been overwritten again

From
Tom Lane
Date:
"Nicolas Bazin" <nbazin@ingenico.com.au> writes:
> We need a little bit of order when several people can commit on the source =
> code, It would be nice that they update their local copy and then commit, o=
> r check the directory or check for conflicts.=20

AFAICT these changes *are* in current sources.
        regards, tom lane


Re: pgc.l modif. has been overwritten again

From
"Nicolas Bazin"
Date:
They are not in postgresql-7.2.1.tar.gz
I just checked the repositary with the CVS web interface and the modif are
not in there.
In CVS you get
<<EOF>>     {                      if ( preproc_tos > 0 )                              {
preproc_tos = 0;                                 mmerror(PARSE_ERROR, ET_FATAL, "Missing
 
'EXEC SQL ENDIF;'");                      }                               if (yy_buffer == NULL)
        yyterminate();                      else
 


where is should be:

<<EOF>>     {                               if (yy_buffer == NULL) {                                   if ( preproc_tos
>0 )                                  {                                     preproc_tos = 0;
        mmerror(PARSE_ERROR, ET_FATAL,
 
"Missing 'EXEC SQL ENDIF;'");                                 }                                 yyterminate();
                    } else
 

And looking and the history of this file I don't see the modif beeing
applied. But I know that at some stage it was applied by Bruce momjian  and
overwritten by Mickeal Meskes ???

Nicolas
----- Original Message -----
From: "Tom Lane" <tgl@sss.pgh.pa.us>
To: "Nicolas Bazin" <nbazin@ingenico.com.au>
Cc: <pgsql-interfaces@postgresql.org>
Sent: Wednesday, March 27, 2002 4:26 PM
Subject: Re: [INTERFACES] pgc.l modif. has been overwritten again


> "Nicolas Bazin" <nbazin@ingenico.com.au> writes:
> > We need a little bit of order when several people can commit on the
source =
> > code, It would be nice that they update their local copy and then
commit, o=
> > r check the directory or check for conflicts.=20
>
> AFAICT these changes *are* in current sources.
>
> regards, tom lane
>
>




Re: pgc.l modif. has been overwritten again

From
Tom Lane
Date:
"Nicolas Bazin" <nbazin@ingenico.com.au> writes:
> They are not in postgresql-7.2.1.tar.gz
> I just checked the repositary with the CVS web interface and the modif are
> not in there.

Hm.  Perhaps you should display your diffs the right way 'round if you
don't want to be misunderstood.

> And looking and the history of this file I don't see the modif beeing
> applied. But I know that at some stage it was applied by Bruce momjian  and
> overwritten by Mickeal Meskes ???

I looked closely at the CVS history for pgc.l, and cannot see any sign
that any such patch was ever applied.  I suggest submitting the patch
formally with an explanation why it's needed (eg, a test case).  The
existing code is not obviously wrong to me.
        regards, tom lane


Re: pgc.l modif. has been overwritten again

From
"Nicolas Bazin"
Date:
Sorry for the order of the patch.

Here is the exchange I had with Micheal.

For a test case try to ecpg with test1.pgc modified this way:
....
exec sql begin declare section;typedef char string[NAMELEN + 1];       intarray amount;int increment=100;       char
name[AMOUNT][NAMELEN+1];charletter[AMOUNT][1];
 
exec sql ifdef NAMELEN;struct name_letter_struct{ char name[NAMELEN + 1]; int amount; char letter;}
name_letter[AMOUNT];
exec sql endif;       struct ind_struct       {               short a;               short b;               short c;
  } ind[AMOUNT];char command[128];
 
....

Nicolas
----- Original Message -----
From: "Nicolas Bazin" <nbazin@ingenico.com.au>
To: "Tom Lane" <tgl@sss.pgh.pa.us>
Cc: <pgsql-interfaces@postgresql.org>
Sent: Wednesday, March 27, 2002 4:46 PM
Subject: Re: [INTERFACES] pgc.l modif. has been overwritten again


> They are not in postgresql-7.2.1.tar.gz
> I just checked the repositary with the CVS web interface and the modif are
> not in there.
> In CVS you get
> <<EOF>>     {
>   if ( preproc_tos > 0 )
>                                {
>                                   preproc_tos = 0;
>                                   mmerror(PARSE_ERROR, ET_FATAL, "Missing
> 'EXEC SQL ENDIF;'");
>   }
>                                 if (yy_buffer == NULL)
>                                   yyterminate();
>   else
>
>
> where is should be:
>
> <<EOF>>     {
>                                 if (yy_buffer == NULL) {
>                                     if ( preproc_tos > 0 )
>                                    {
>                                       preproc_tos = 0;
>                                       mmerror(PARSE_ERROR, ET_FATAL,
> "Missing 'EXEC SQL ENDIF;'");
>                                   }
>                                   yyterminate();
>                                 } else
>
> And looking and the history of this file I don't see the modif beeing
> applied. But I know that at some stage it was applied by Bruce momjian
and
> overwritten by Mickeal Meskes ???
>
> Nicolas
> ----- Original Message -----
> From: "Tom Lane" <tgl@sss.pgh.pa.us>
> To: "Nicolas Bazin" <nbazin@ingenico.com.au>
> Cc: <pgsql-interfaces@postgresql.org>
> Sent: Wednesday, March 27, 2002 4:26 PM
> Subject: Re: [INTERFACES] pgc.l modif. has been overwritten again
>
>
> > "Nicolas Bazin" <nbazin@ingenico.com.au> writes:
> > > We need a little bit of order when several people can commit on the
> source =
> > > code, It would be nice that they update their local copy and then
> commit, o=
> > > r check the directory or check for conflicts.=20
> >
> > AFAICT these changes *are* in current sources.
> >
> > regards, tom lane
> >
> >
>
I can give it a try, but I'm not familiar with lex and yacc so I can't
promise anything.

Nicolas
----- Original Message -----
From: "Michael Meskes" <meskes@postgresql.org>
To: "Nicolas Bazin" <nbazin@ingenico.com.au>
Cc: <pgsql-interfaces@postgresql.org>
Sent: Monday, March 11, 2002 11:55 PM
Subject: Re: Subject: Re: Additional fixes to ecpg - please apply patch


> On Mon, Mar 11, 2002 at 12:41:33PM +1100, Nicolas Bazin wrote:
> > It works except that you overwrote a previous patch I submitted that was
already applied (see mail joined).
>
> I'm sorry for that. Since I thought cvs would merge the changes I didn't
> check.
>
> > Sorry for sending you a diff in the wrong order.
>
> No problem.
>
> > Also I though the type definition syntax could be enhanced. Instaead of
defining
> > ...
> > Both syntax can be maintained for compatibility of existing
> > application, but I find the second one easier to maintain because
> > there is no code duplication.Can you do it ? Nicolas
>
> Yes, you are right. The first should be kept for compatibility, but the
> second i seasier to use. I will ad this to my todo list. But I have no
> idea at all, when I will find time to implement it. So, if you can send
> patches, they are more than welcome.
>
> Michael
> --
> Michael Meskes
> Michael@Fam-Meskes.De
> Go SF 49ers! Go Rhein Fire!
> Use Debian GNU/Linux! Use PostgreSQL!
>

Re: pgc.l modif. has been overwritten again

From
Michael Meskes
Date:
On Wed, Mar 27, 2002 at 04:46:26PM +1100, Nicolas Bazin wrote:
> They are not in postgresql-7.2.1.tar.gz
> I just checked the repositary with the CVS web interface and the modif are
> not in there.

That's what the patch you send me causes it to look like.

> And looking and the history of this file I don't see the modif beeing
> applied. But I know that at some stage it was applied by Bruce momjian  and
> overwritten by Mickeal Meskes ???

It seems some of the patches you send out were reversed. So when Bruce applied
it he obviously noticed but I didn't since the patch applied cleanly.
Then I committed again and it was gone. I did apply your patch on Mar
21st a say before leaving for vacation so I didn't check as thoroughly
as I should have. But that's how it happens.

It seems your patch is now part of the CVS archive. And the test case
works. So I leave it alone and do not apply it. :-)

Michael
-- 
Michael Meskes
Michael@Fam-Meskes.De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!