Re: 09.03.0400 broken on 32bit

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Christoph Berg <christoph(dot)berg(at)credativ(dot)de>, PostgreSQL ODBC <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: 09.03.0400 broken on 32bit
Date: 2014-11-13 21:40:36
Message-ID: 54652554.1060804@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

On 11/12/2014 02:21 PM, Christoph Berg wrote:
> Hi,
>
> 09.03.0400 is broken on all 32bit architectures:
>
> https://buildd.debian.org/status/logs.php?pkg=psqlodbc&ver=1%3A09.03.0400-1
>
> ...
>
> *** /home/cbe/projects/postgresql/psqlodbc/psqlodbc/test/expected/result-conversions.out 2014-10-26 07:08:38.000000000 +0100
> --- /home/cbe/projects/postgresql/psqlodbc/psqlodbc/test/results/result-conversions.out 2014-11-12 13:18:49.990297759 +0100
> ***************
> *** 356,371 ****
> 'textdata' (text) as SQL_C_INTERVAL_MINUTE_TO_SECOND: interval sign: 0 unknown interval type: 0
> '3234567901' (oid) as SQL_C_CHAR: 3234567901
> '3234567901' (oid) as SQL_C_WCHAR: 3234567901
> ! '3234567901' (oid) as SQL_C_SSHORT: -26915
> ! '3234567901' (oid) as SQL_C_USHORT: 38621
> ! '3234567901' (oid) as SQL_C_SLONG: -1060399395
> '3234567901' (oid) as SQL_C_ULONG: 3234567901
> '3234567901' (oid) as SQL_C_FLOAT: 3234567936.000000
> '3234567901' (oid) as SQL_C_DOUBLE: 3234567901.000000
> ! '3234567901' (oid) as SQL_C_BIT: 221
> ! '3234567901' (oid) as SQL_C_STINYINT: -35
> ! '3234567901' (oid) as SQL_C_UTINYINT: 221
> ! '3234567901' (oid) as SQL_C_SBIGINT: 3234567901
> '3234567901' (oid) as SQL_C_UBIGINT: 3234567901
> '3234567901' (oid) as SQL_C_BINARY: SQLGetData failed
> 07006=Received an unsupported type from Postgres.
> --- 356,371 ----
> 'textdata' (text) as SQL_C_INTERVAL_MINUTE_TO_SECOND: interval sign: 0 unknown interval type: 0
> '3234567901' (oid) as SQL_C_CHAR: 3234567901
> '3234567901' (oid) as SQL_C_WCHAR: 3234567901
> ! '3234567901' (oid) as SQL_C_SSHORT: -1
> ! '3234567901' (oid) as SQL_C_USHORT: 65535
> ! '3234567901' (oid) as SQL_C_SLONG: 2147483647
> '3234567901' (oid) as SQL_C_ULONG: 3234567901
> '3234567901' (oid) as SQL_C_FLOAT: 3234567936.000000
> '3234567901' (oid) as SQL_C_DOUBLE: 3234567901.000000
> ! '3234567901' (oid) as SQL_C_BIT: 255
> ! '3234567901' (oid) as SQL_C_STINYINT: -1
> ! '3234567901' (oid) as SQL_C_UTINYINT: 255
> ! '3234567901' (oid) as SQL_C_SBIGINT: -1060399395
> '3234567901' (oid) as SQL_C_UBIGINT: 3234567901
> '3234567901' (oid) as SQL_C_BINARY: SQLGetData failed
> 07006=Received an unsupported type from Postgres.

Hmm. The difference is in the conversion of an integer value larger than
2^31, to a C type that's not large enough to hold it. According to the
ODBC spec, that's supposed to raise an error, sqlstate 22015, and the
result is undefined.
(http://msdn.microsoft.com/en-us/library/ms712567%28v=vs.85%29.aspx).

I actually removed those particular test cases after the 09.03.0400
release, when I added tests for large objects. The above OID conversion
tests started to behave differently after the "lo" domain, for large
objects. So the issue should be resolved in git master already, by accident.

The real issue here is that the driver doesn't raise an error when a
numeric value's whole part is truncated.

- Heikki

In response to

Browse pgsql-odbc by date

  From Date Subject
Next Message perry@processlinx.com 2014-11-14 15:47:19 issue
Previous Message Heikki Linnakangas 2014-11-13 13:48:36 Re: application_name