Re: Add missing const qualifier in ECPG

From: Qingqing Zhou <zhouqq(at)cs(dot)toronto(dot)edu>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Add missing const qualifier in ECPG
Date: 2005-11-12 23:21:55
Message-ID: Pine.LNX.4.58.0511121816350.9886@eon.cs
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Christopher Kings-Lynne 2005-11-13 06:15:14 Re: Multi-table-unique-constraint
Previous Message Peter Eisentraut 2005-11-12 23:14:01 Re: Add missing const qualifier in ECPG