From: Werewolf <werewolfff@yandex.ru>
To: pgsql-bugs@lists.postgresql.org
Subject: ODBC: SQLGetDescField returns incorrect length for SQL_DESC_COUNT field of APD
Date: Tue, 18 Jun 2019 22:31:17 +0300
Message-ID: <1fe4d02c-9744-d02e-7cb4-76d259e01792@yandex.ru> (raw)
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<font face="Helvetica, Arial, sans-serif">Field SQL_DESC_COUNT
should fit into a variable of type SQLSMALLINT. But when </font><font
face="Helvetica, Arial, sans-serif"><span class="tlid-translation
translation" lang="en">retrieving this field of APD </span>SQLGetDescField
returns SQLINTEGER value. So memory corruption is possible in
application using psqlodbc driver.<br>
Also the function returns an undefined error code -8.<br>
<br>
The mistake is located here<br>
<a class="moz-txt-link-freetext" href="https://git.postgresql.org/gitweb/?p=psqlodbc.git;a=blob;f=pgapi30.c;h=ba0dd6d731bbccd81392def43ae9b...;
<br>
Just replace 'ret = SQL_IS_SMALLINT;' with 'rettype =
SQL_IS_SMALLINT;'.<br>
</font>
</body>
</html>
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-bugs@postgresql.org
Cc: werewolfff@yandex.ru
Subject: Re: ODBC: SQLGetDescField returns incorrect length for SQL_DESC_COUNT field of APD
In-Reply-To: <1fe4d02c-9744-d02e-7cb4-76d259e01792@yandex.ru>
References: <1fe4d02c-9744-d02e-7cb4-76d259e01792@yandex.ru>
* 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