ODBC: SQLGetDescField returns incorrect length for SQL_DESC_COUNT field of APD

From: Werewolf <werewolfff(at)yandex(dot)ru>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: ODBC: SQLGetDescField returns incorrect length for SQL_DESC_COUNT field of APD
Date: 2019-06-18 19:31:17
Message-ID: 1fe4d02c-9744-d02e-7cb4-76d259e01792@yandex.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

<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=ba0dd6d731bbccd81392def43ae9b10e9c013aef;hb=HEAD#l1240">https://git.postgresql.org/gitweb/?p=psqlodbc.git;a=blob;f=pgapi30.c;h=ba0dd6d731bbccd81392def43ae9b10e9c013aef;hb=HEAD#l1240</a><br>
<br>
Just replace 'ret = SQL_IS_SMALLINT;' with 'rettype =
SQL_IS_SMALLINT;'.<br>
</font>
</body>
</html>

Attachment Content-Type Size
unknown_filename text/html 1.1 KB

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2019-06-19 01:22:09 Re: BUG #15859: Postgres 11 repository is missing extensions
Previous Message PG Bug reporting form 2019-06-18 18:44:34 BUG #15859: Postgres 11 repository is missing extensions