Re: PQcmdTuples() declaration

Поиск
Список
Период
Сортировка
От Payman
Тема Re: PQcmdTuples() declaration
Дата
Msg-id 3DCB82F0.4070607@Club-Internet.fr
обсуждение исходный текст
Ответ на Re: PQcmdTuples() declaration  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-interfaces
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?
>
>  
>




В списке pgsql-interfaces по дате отправления:

Предыдущее
От: "Jan Klostermann"
Дата:
Сообщение: Wish to build a LabVIEW-Interface (= graphical programming language)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: PQcmdTuples() declaration