From: Hiroshi Inoue <Inoue@tpf.co.jp>
To: zh_ok@163.net
Cc: pgsql-odbc@postgresql.org <pgsql-odbc@postgresql.org>
Subject: Re: Problem with SQLGetTypeInfo
Date: Fri, 05 Jul 2002 10:17:33 +0900
Message-ID: <3D24F3AD.4AA20A87@tpf.co.jp> (raw)
References: <20020704140847.653CA1D48BF6B@bjapp14.163.net>
> Zhou Han wrote:
>
> There's a missmatch in the following functions:
>
> Int4
> PGtype_precision(StatementClass *stmt, Int4 type, int col, int
> handle_unknown_size_as)
> {
>
> switch (type)
> {
>
> case PG_TYPE_CHAR:
> return 1;
> ...
>
> }
>
> char *
> pgtype_create_params(StatementClass *stmt, Int4 type)
> {
> switch (type)
> {
> case PG_TYPE_CHAR:
> case PG_TYPE_VARCHAR:return "max. length";
> default:
> return NULL;
> }
> }
>
> "case PG_TYPE_CHAR" should be changed to "case PG_TYPE_BPCHAR", or
> there will be a error when use SQLGetTypeInfo. Because the precision
> of PG_TYPE_CHAR is 1, it should return NULL in function
> "pgtype_create_params" instead of "max. length"!!!
>
> What do you think?
You seem to be right.
I would change PG_TYPE_CHAR to PG_TYPE_BPCHAR.
Thanks for your report.
Hiroshi Inoue
http://w2422.nsk.ne.jp/~inoue/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: Inoue@tpf.co.jp, zh_ok@163.net
Subject: Re: Problem with SQLGetTypeInfo
In-Reply-To: <3D24F3AD.4AA20A87@tpf.co.jp>
References: <20020704140847.653CA1D48BF6B@bjapp14.163.net> <3D24F3AD.4AA20A87@tpf.co.jp>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox