Re: Add missing const qualifier in ECPG - Mailing list pgsql-patches

From Qingqing Zhou
Subject Re: Add missing const qualifier in ECPG
Date
Msg-id Pine.LNX.4.58.0511121816350.9886@eon.cs
Whole thread Raw
In response to Re: Add missing const qualifier in ECPG  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-patches

On Sat, 12 Nov 2005, Peter Eisentraut wrote:

> Qingqing Zhou wrote:
> > ***************
> > *** 149,155 ****
> >       if (!(*stmt = (struct statement *) ECPGalloc(sizeof(struct
> > statement), lineno))) return false;
> >
> > !     (*stmt)->command = query;
> >       (*stmt)->connection = connection;
> >       (*stmt)->lineno = lineno;
> >       (*stmt)->compat = compat;
> > --- 150,156 ----
> >       if (!(*stmt = (struct statement *) ECPGalloc(sizeof(struct
> > statement), lineno))) return false;
> >
> > !     (*stmt)->command = (char *)query;
> >       (*stmt)->connection = connection;
> >       (*stmt)->lineno = lineno;
> >       (*stmt)->compat = compat;
>
> This sort of "cheating" should be avoided.
>


Yeah ... this is a "cheating" trade ... :-)

*** 1417,1423 ****
  ECPGdo_descriptor(int line, const char *connection,
                    const char *descriptor, const char *query)
  {
!     return ECPGdo(line, ECPG_COMPAT_PGSQL, true, connection, (char *) query, ECPGt_EOIT,
                    ECPGt_descriptor, descriptor, 0L, 0L, 0L,
                    ECPGt_NO_INDICATOR, NULL, 0L, 0L, 0L, ECPGt_EORT);
  }
--- 1418,1424 ----
  ECPGdo_descriptor(int line, const char *connection,
                    const char *descriptor, const char *query)
  {
!     return ECPGdo(line, ECPG_COMPAT_PGSQL, true, connection, query, ECPGt_EOIT,
                    ECPGt_descriptor, descriptor, 0L, 0L, 0L,
                    ECPGt_NO_INDICATOR, NULL, 0L, 0L, 0L, ECPGt_EORT);
  }

Regards,
Qingqing

pgsql-patches by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Add missing const qualifier in ECPG
Next
From: "Stephen R. van den Berg"
Date:
Subject: contrib/xinetops for 8.1 "patch"