Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TA8Ki-0002RX-TM for pgsql-odbc@postgresql.org; Fri, 07 Sep 2012 23:51:32 +0000 Received: from sd.tpf.co.jp ([210.161.239.34]) by magus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TA8Ke-0001Pi-U1 for pgsql-odbc@postgresql.org; Fri, 07 Sep 2012 23:51:32 +0000 Received: (qmail 26465 invoked by uid 512); 7 Sep 2012 23:51:23 -0000 X-Authentication: inoue was authenticated by sd.tpf.co.jp at 7 Sep 2012 23:51:23 -0000 Received: from unknown (HELO ?192.168.2.100?) (183.76.21.62) by sd.tpf.co.jp with SMTP; 7 Sep 2012 23:51:23 -0000 Message-ID: <504A8867.7020103@tpf.co.jp> Date: Sat, 08 Sep 2012 08:51:03 +0900 From: Hiroshi Inoue User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:15.0) Gecko/20120824 Thunderbird/15.0 MIME-Version: 1.0 To: Boszormenyi Zoltan CC: Hiroshi Saito , pgsql-odbc@postgresql.org, =?ISO-8859-2?Q?Hans-J=FCrgen_Sch=F6nig?= Subject: Re: Error reporting goes into an infinite loop when compiled --with-odbcver=0x0250 References: <50409E40.10803@cybertec.at> <5041D33B.7020509@tpf.co.jp> <5042284C.1000105@cybertec.at> <50424250.602@cybertec.at> In-Reply-To: <50424250.602@cybertec.at> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201209/7 X-Sequence-Number: 10946 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