8.3devel BUG with Cash send and recv

Поиск
Список
Период
Сортировка
От Andrew Chernow
Тема 8.3devel BUG with Cash send and recv
Дата
Msg-id 46C8A3A1.9010203@esilo.com
обсуждение исходный текст
Список pgsql-bugs
There is what looks like a bug in 8.3devel.  When getting the money type in
binary format from a libpq client, the below error is thrown from the backend:

ERROR:  unsupported integer size 8

It appears that the Cash typedef, defined in include/utils/cash.h, has changed
to an int64 (previously an int32).  The cash_send and cash_recv functions, in
backend/utils/adt/cash.c, are still calling pq_sendint and pq_getmsgint.

I tested on an 8.2rc box and that did not suffer from this issue because it uses
a 32-bit Cash type.

Below is a test to reproduce the issue.

create table money_test (amount money);
insert into money_test values ('13.85');

/* libpq test code (breaks on 8.3devel, works on 8.2rc) */
#include <libpq-fe.h>
#include <stdio.h>

int main(void)
{
   PGresult *res;
   PGconn *conn = PQconnectdb("hostaddr=127.0.0.1  user=postgres");

   if(PQstatus(conn) != CONNECTION_OK)
   {
     printf("connection failure\n");
     return 1;
   }

   res = PQexecParams(
     conn,
     "SELECT amount FROM money_test LIMIT 1",
     0,
     (const Oid *)NULL,
     (const char * const *)NULL,
     (const int *)NULL,
     (const int *)NULL,
     1); /* binary */

   printf("tuples=%d, err=%s, res_err=%s\n",
     PQntuples(res),
     PQerrorMessage(conn),
     PQresultErrorMessage(res));

   PQclear(res);
   PQfinish(conn);
   return 0;
}

andrew

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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: BUG #3555: does not work VACUUM
Следующее
От: "Ruediger Kemmler"
Дата:
Сообщение: BUG #3556: Installroutine hides destination folder