From: Payman <payman@Club-Internet.fr>
To: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: Michael Klatt <mdklatt@ou.edu>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: PQcmdTuples() declaration
Date: Fri, 08 Nov 2002 10:25:04 +0100
Message-ID: <3DCB82F0.4070607@Club-Internet.fr> (raw)
References: <200211080511.gA85B2K11157@candle.pha.pa.us>
Hi Bruce,
The code compile ok, PGresult *res is not changed
in source code of PQcmdTuples, for me it's a const PGresult *res.
Now the probleme is : who put it in non const and why ?
Is changing this will cause problems in actual project for anyone?
Other thing is, PQcmdTuples return numbre of tuples after a insert,
delete, update
I say Number, Number is a numerical value and not String value ...
in libpq++ :
int PgDatabase::CmdTuples() const
{
const char *a = PQcmdTuples(pgResult);
return a[0] ? atoi(a) : -1;
}
return int value and not char *
(changing this cause more problems for other users...)
thanks
Payman
Bruce Momjian wrote:
>I am not sure how to deal with this. I have updated the 7.3/CVS docs to
>match the include file and code, which has no consts.
>
>The issue with PQcmdTuples() and PQcmdStatus() are that they return
>*result structure member pointers. The patch makes the *result a const,
>then we have to return the values as const's. The code compiled OK, so
>I assume that is fine. How does that sound to others, or should we keep
>the result non-const?
>
>
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: payman@Club-Internet.fr, pgman@candle.pha.pa.us, mdklatt@ou.edu
Subject: Re: PQcmdTuples() declaration
In-Reply-To: <3DCB82F0.4070607@Club-Internet.fr>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox