pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hiroshi Inoue <inoue@tpf.co.jp>
To: Heikki Linnakangas <hlinnakangas@vmware.com>
Cc: pgsql-odbc@postgresql.org
Subject: Re: Source code cleanup
Date: Fri, 11 Jan 2013 12:40:17 +0900
Message-ID: <50EF89A1.7040800@tpf.co.jp> (raw)
In-Reply-To: <50EE3C66.1080801@tpf.co.jp>
References: <50EC64A5.10702@vmware.com>
	<50EE3C66.1080801@tpf.co.jp>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>

Hi Heikki,

(2013/01/10 12:58), Inoue, Hiroshi wrote:
> Hi Heikki,
>
> (2013/01/09 3:25), Heikki Linnakangas wrote:
>> I'm getting a bunch of compiler warnings when I compile the latest
>> psqlodbc sources from CVS. I spent some time cleaning those up.
>>
>> I also got access to a report of a Coverity scan over psqlodbc source
>> tree. That found a bunch of additional issues, some of which were
>> genuine (minor) bugs. I'm still in the process of going through the
>> report, but I fixed some bugs already.
>
> Thanks.
>
>>
>> I also wrote a small regression test suite to test with. It only tests a
>> few of the ODBC functions at the moment, but it's better than nothing,
>> and it can be easily extended. What do others use for testing psqlodbc?
>>
>> I pushed the result to a git repository at
>> git@github.com:hlinnaka/psqlodbc.git. It contains the psqlodbc CVS
>> history, as converted by git cvsimport, and my changes as commits on top
>> of that.
>
> I would check the git repository.

The 1st question I have is about the change

commit 80b3eb35ab1428949f7ab8fbd567d5d49655dc02
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date:   Sat Jan 5 00:35:39 2013 +0200

     Silence Coverity warnings about passing negative param to
	SQLExecDirect.
     It doesn't know about the psqlodbc extension to that function that
  	passing SQL_NTS means it's a C-style null-terminated string.

The type of the 3rd parameter of SQLExecDirect() is SQLINTEGER.
What kind od warnings does Coverity scan show?
SQL_NTS is generally used in ODBC and I could hardly remember the
examples which use parameters other than SQL_NTS.

In addition the change doesn't seem correct to me.
The 3rd parameter of the following SQLExecDirect call is the
string length of a Statement Handle.

                  ret = SQLExecDirect(stmt, (SQLCHAR *) "select gid from 
pg_prepared_xacts", strlen(stmt));


regards,
Hiroshi Inoue



-- 
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc



view thread (4+ messages)  latest in thread

Message-ID: <50EF89A1.7040800@tpf.co.jp>
Permalink:  ../50EF89A1.7040800@tpf.co.jp/
Also on:    postgresql.org/message-id/50EF89A1.7040800@tpf.co.jp

 · 

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: inoue@tpf.co.jp, hlinnakangas@vmware.com
  Subject: Re: Source code cleanup
  In-Reply-To: <50EF89A1.7040800@tpf.co.jp>
  References: <50EC64A5.10702@vmware.com> <50EE3C66.1080801@tpf.co.jp> <50EF89A1.7040800@tpf.co.jp>

* 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