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

Поиск
Список
Период
Сортировка
От Hiroshi Inoue
Тема Re: select from a table having more than 32 fields: Quick Workaround
Дата
Msg-id 3A948CB9.7B2AD712@tpf.co.jp
обсуждение исходный текст
Ответ на select from a table having more than 32 fields: Quick Workaround  ("Matteo Cavalleri" <theos@bp.lnf.it>)
Ответы Re: select from a table having more than 32 fields: Quick Workaround  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-odbc
Tom Lane wrote:
>
> "Matteo Cavalleri" <theos@bp.lnf.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.
>

I've just committed a fix according to Tom's analysis.
Thanks to Tom for his accurate analysis as usual.
Matteo, if you want to check the change I would send
you a binary.

Regards,
Hiroshi Inoue

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: select from a table having more than 32 fields: Quick Workaround
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: select from a table having more than 32 fields: Quick Workaround