Re: select from a table having more than 32 fields: Quick Workaround

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Matteo Cavalleri" <theos(at)bp(dot)lnf(dot)it>
Cc: pgsql-odbc(at)postgresql(dot)org
Subject: Re: select from a table having more than 32 fields: Quick Workaround
Date: 2001-02-21 23:56:07
Message-ID: 13059.982799767@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

"Matteo Cavalleri" <theos(at)bp(dot)lnf(dot)it> writes:
> A select from a table having more than 32 fields fails during
> SQLDescribeCol on field # 33.

> In my opinion the driver try to allocate space for fields in blocks of
> 32 items as defined in FLD_INCR (parse.c) . The realloc() works
> well but for some reasons the fi pointer seems to get lost during
> SQLDescribeCol on column 1.

I think the bug is in lines 681-694 (of current CVS sources). Actually
there are a couple bugs there: first that the new fi value is not stored
back into stmt->fi (your complaint). Secondly, the calculation of
required space looks to me to have a bunch of errors, both fencepost
type (roundup of stmt->nfld to number of slots actually allocated is
wrong) and conceptual (roundup should be done on total number of slots
needed, not on parts of it). I have no way to test ODBC, though, so
I won't try to fix it.

regards, tom lane

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Hiroshi Inoue 2001-02-22 03:51:21 Re: select from a table having more than 32 fields: Quick Workaround
Previous Message Matteo Cavalleri 2001-02-21 15:49:48 select from a table having more than 32 fields: Quick Workaround