pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tilghman Lesher <tilghman@mail.jeffandtilghman.com>
To: pgsql-odbc@postgresql.org
Subject: Bug in SQLColumns
Date: Fri, 27 Jul 2007 18:08:09 -0500
Message-ID: <200707271808.09470.tilghman@mail.jeffandtilghman.com> (raw)

The specification for SQLColumns states:

Column 16 CHAR_OCTET_LENGTH (INTEGER) 
Contains the maximum length in octets for a character data type column.
For Single Byte character sets, this is the same as COLUMN_SIZE. For
all other data types it is NULL.

However, as currently implemented in psqlodbc-08.02.0300, it is always
encoded as NULL.  Patch attached.

-- 
Tilghman

Attachments:

20070727__octet_length.diff.txt (text/plain, 1003B) download --- info.c.old 2007-07-27 18:04:07.000000000 -0500 +++ info.c 2007-07-27 18:04:16.000000000 -0500 @@ -2329,7 +2329,10 @@ set_tuplefield_null(&tuple[COLUMNS_COLUMN_DEF]); set_tuplefield_int2(&tuple[COLUMNS_SQL_DATA_TYPE], sqltype); set_tuplefield_null(&tuple[COLUMNS_SQL_DATETIME_SUB]); - set_tuplefield_null(&tuple[COLUMNS_CHAR_OCTET_LENGTH]); + if (the_type == PG_TYPE_CHAR || the_type == PG_TYPE_CHAR2 || the_type == PG_TYPE_CHAR4 || the_type == PG_TYPE_CHAR8 || the_type == PG_TYPE_NAME || the_type == PG_TYPE_BPCHAR || the_type == PG_TYPE_VARCHAR || the_type == PG_TYPE_TEXT || the_type == PG_TYPE_BYTEA || the_type == PG_TYPE_LO_UNDEFINED) + set_tuplefield_int4(&tuple[COLUMNS_CHAR_OCTET_LENGTH], pgtype_buffer_length(stmt, the_type, PG_STATIC, PG_STATIC)); + else + set_tuplefield_null(&tuple[COLUMNS_CHAR_OCTET_LENGTH]); set_tuplefield_int4(&tuple[COLUMNS_ORDINAL_POSITION], ordinal); set_tuplefield_string(&tuple[COLUMNS_IS_NULLABLE], "No"); #endif /* ODBCVER */

Message-ID: <200707271808.09470.tilghman@mail.jeffandtilghman.com>
Permalink:  ../200707271808.09470.tilghman@mail.jeffandtilghman.com/
Also on:    postgresql.org/message-id/200707271808.09470.tilghman@mail.jeffandtilghman.com

 · 

reply

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: tilghman@mail.jeffandtilghman.com
  Subject: Re: Bug in SQLColumns
  In-Reply-To: <200707271808.09470.tilghman@mail.jeffandtilghman.com>
  References: <200707271808.09470.tilghman@mail.jeffandtilghman.com>

* 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