From: Hiroshi Inoue <inoue@tpf.co.jp>
To: Boszormenyi Zoltan <zb@cybertec.at>
Cc: Hiroshi Saito <hiroshi@winpg.jp>
Cc: pgsql-odbc@postgresql.org, Hans-Jürgen Schönig <hs@cybertec.at>
Subject: Re: Error reporting goes into an infinite loop when compiled --with-odbcver=0x0250
Date: Sat, 08 Sep 2012 08:51:03 +0900
Message-ID: <504A8867.7020103@tpf.co.jp> (raw)
In-Reply-To: <50424250.602@cybertec.at>
References: <50409E40.10803@cybertec.at>
<5041D33B.7020509@tpf.co.jp>
<5042284C.1000105@cybertec.at>
<50424250.602@cybertec.at>
Hi,
Sorry for the late reoly.
(2012/09/02 2:13), Boszormenyi Zoltan wrote:
> Hi,
>
> 2012-09-01 17:22 keltezéssel, Boszormenyi Zoltan írta:
>> Hi,
>>
>> 2012-09-01 11:19 keltezéssel, Hiroshi Inoue írta:
>>> Hi,
>>>
>>> (2012/08/31 20:21), Boszormenyi Zoltan wrote:
>>>> Hi,
>>>>
>>>> we had to recently test psqlODBC with an older application
>>>> which doesn't expect ODBC 3.x.
>>>>
>>>> The problem is that the client locks up as soon as it encounters
>>>> an error of any kind, like restarting the server from under the client
>>>> or simply executing a bad query.
>>>>
>>>> After debugging the problem and reading the code of both
>>>> unixODBC 2.3.1 and psqlODBC (version 09.00.0310 and 09.01.0200),
>>>> I discovered that the DriverManager calls the driver's SQLError()
>>>> and SQLGetDiagRec() in a loop
>>>
>>> Does the DriverManager call both SQLError() and SQLGetDiagRec()?
>>
>> Yes, it detects which is supported and calls that in the error handler
>> part
>> of SQLExecute(). In case psqlODBC is compiled using
>> --with-odbcver=0x0250,
>> SQLGetDiagRec() is naturally not supported.
>>
>>> Could you send me (loop part of) the Mylog output?
>>
>> I attached the unixODBC tracefile (/tmp/Trace.txt), there is no "mylog"
>> lines in it. I execute a single "select * from test;" and this table
>> doesn't exist.
>> The trace file shows that the error code is repeated ad infinitum.
>>
>> But for my debugging, I didn't use the ODBC tracing, I added my extra
>> printf()s
>> so I can see on the client terminal what is going on.
>
> Attached is the mylog output for the vanilla psqlODBC 09.01.0200
> which also shows the infinite loop.
Thanks.
Clearing error info seems to cause the infinite loop.
Simply removing the follwoing code would solve the bug.
COuld you try it?
if (error->errorpos >= msglen)
{
ER_Destructor(error);
*pgerror = NULL;
}
regards,
Hiroshi Inoue
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, zb@cybertec.at, hiroshi@winpg.jp, hs@cybertec.at
Subject: Re: Error reporting goes into an infinite loop when compiled --with-odbcver=0x0250
In-Reply-To: <504A8867.7020103@tpf.co.jp>
References: <50409E40.10803@cybertec.at> <5041D33B.7020509@tpf.co.jp> <5042284C.1000105@cybertec.at> <50424250.602@cybertec.at> <504A8867.7020103@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