Re: Bug #693: python interface doesn't handle int8 correctly.

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Bug #693: python interface doesn't handle int8 correctly.
Дата
Msg-id 200208262257.g7QMvaF24054@candle.pha.pa.us
обсуждение исходный текст
Ответ на Bug #693: python interface doesn't handle int8 correctly.  (pgsql-bugs@postgresql.org)
Ответы Re: Bug #693: python interface doesn't handle int8 correctly.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Could you supply a patch?

---------------------------------------------------------------------------

pgsql-bugs@postgresql.org wrote:
> Ragnar Kjørstad (postgresql@ragnark.vesdtata.no) reports a bug with a severity of 3
> The lower the number the more severe it is.
>
> Short Description
> python interface doesn't handle int8 correctly.
>
> Long Description
> This applies to postgresql 7.2.1 on linux x86 (32 bit)
>
> getresult() and dictresult() return int4 data in a python int object, but it should use a python long object, or it
willoverflow. 
>
> >From postgresql-7.2.1/src/interfaces/python:pgquery_dictresult  :
> switch (PQftype(self->last_result, j)) {
>   case INT2OID:
>   case INT4OID:
>   case INT8OID:
>   case OIDOID:
>      typ[j] = 1;
>      break;
> }
> ...
> switch (typ[j]) {
>   case 1:
>     val = PyInt_FromLong(strtol(s, NULL, 10));
>     break;
> }
>
>
> clearly this is wrong....
>
>
> Sample Code
>
>
> No file was uploaded with this report
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Bug #747: PostgreSQL doesn't use indexes right sometimes
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Bug #693: python interface doesn't handle int8 correctly.