Обсуждение: ODBC Driver int8 Patch

Поиск
Список
Период
Сортировка

ODBC Driver int8 Patch

От
Dave Page
Дата:
Hi,

It was suggested that I post this patch here as no notice was taken of it
when posted to interfaces!

This fixes problems with int8 columns which are reported by the driver as
SQL_BIGINT rather than SQL_CHAR as per the ODBC v2 spec. Specifically, I
have had problems with MS ADO - any queries that contain an int8 column in
the resultset will *always* return an empty recordset.

Regards,

Dave.

*** pgtypes.c.orig      Fri Dec 22 09:12:22 2000
--- pgtypes.c   Fri Dec 22 09:12:22 2000
***************
*** 217,223 ****       case PG_TYPE_XID:       case PG_TYPE_INT4:          return SQL_INTEGER;

!       case PG_TYPE_INT8:                      return SQL_BIGINT;       case PG_TYPE_NUMERIC:           return
SQL_NUMERIC;
       case PG_TYPE_FLOAT4:        return SQL_REAL;
--- 217,223 ----       case PG_TYPE_XID:       case PG_TYPE_INT4:          return SQL_INTEGER;

!       case PG_TYPE_INT8:                      return SQL_CHAR;       case PG_TYPE_NUMERIC:           return
SQL_NUMERIC;
       case PG_TYPE_FLOAT4:        return SQL_REAL;


Re: ODBC Driver int8 Patch

От
Bruce Momjian
Дата:
As I remember, the problem is that this makes us match the ODBC v2 spec,
but then we would not match the v3 spec.  Is that correct?


[ Charset ISO-8859-1 unsupported, converting... ]
> Hi,
> 
> It was suggested that I post this patch here as no notice was taken of it
> when posted to interfaces!
> 
> This fixes problems with int8 columns which are reported by the driver as
> SQL_BIGINT rather than SQL_CHAR as per the ODBC v2 spec. Specifically, I
> have had problems with MS ADO - any queries that contain an int8 column in
> the resultset will *always* return an empty recordset.
> 
> Regards,
> 
> Dave.
> 
> *** pgtypes.c.orig      Fri Dec 22 09:12:22 2000
> --- pgtypes.c   Fri Dec 22 09:12:22 2000
> ***************
> *** 217,223 ****
>         case PG_TYPE_XID:
>         case PG_TYPE_INT4:          return SQL_INTEGER;
> 
> !       case PG_TYPE_INT8:                      return SQL_BIGINT;
>         case PG_TYPE_NUMERIC:           return SQL_NUMERIC;
> 
>         case PG_TYPE_FLOAT4:        return SQL_REAL;
> --- 217,223 ----
>         case PG_TYPE_XID:
>         case PG_TYPE_INT4:          return SQL_INTEGER;
> 
> !       case PG_TYPE_INT8:                      return SQL_CHAR;
>         case PG_TYPE_NUMERIC:           return SQL_NUMERIC;
> 
>         case PG_TYPE_FLOAT4:        return SQL_REAL;
> 


--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


RE: ODBC Driver int8 Patch

От
Dave Page
Дата:

> -----Original Message-----
> From: Bruce Momjian [mailto:pgman@candle.pha.pa.us]
> Sent: 16 January 2001 16:50
> To: Dave Page
> Cc: 'pgsql-hackers@postgresql.org'
> Subject: Re: [HACKERS] ODBC Driver int8 Patch
> 
> 
> As I remember, the problem is that this makes us match the 
> ODBC v2 spec,
> but then we would not match the v3 spec.  Is that correct?
> 

Yes, the patch I supplied will make it correct for v2. As it stands it is
correct for v3. However as the driver identifies itself as v2 (i believe now
v2.5) compliant, ADO expects it to follow the v2 spec and then fails when it
doesn't. 

The original problem was briefly discussed on the interfaces list under the
thread '[INTERFACES] Problems with int8 and MS ADO/ODBC'

Regards,

Dave.