Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group