Re: Crash when using 'Use Declare/Fetch' and the result set does contain one row only - Mailing list pgsql-odbc

From Heikki Linnakangas
Subject Re: Crash when using 'Use Declare/Fetch' and the result set does contain one row only
Date
Msg-id 53A98088.3020301@vmware.com
Whole thread Raw
In response to Re: Crash when using 'Use Declare/Fetch' and the result set does contain one row only  ("Jan-Peter Seifert" <Jan-Peter.Seifert@gmx.de>)
Responses Re: Crash when using 'Use Declare/Fetch' and the result set does contain one row only  ("Jan-Peter Seifert" <Jan-Peter.Seifert@gmx.de>)
List pgsql-odbc
On 06/24/2014 12:06 PM, Jan-Peter Seifert wrote:
> I've attached a zip file containing a Visual Studio 2010 project
> tested on a 'PostgreSQL Unicode' system-DSN named TestODBC and a dump
> of a test database named TestODBC. The line with the statement that
> returns one row is commented out. The other returns 5 rows in the
> release version - it skips the first line and returns the last row
> twice though. When using the debugger it crashes on the last row.

I committed the attached patch to fix this. I admit I don't understand
very well how the cursor and cached result set row counting is supposed
to work. But I think this is correct, so I'll commit it unless someone
sees a problem with it. This patch also includes a regression test for
this. I created it using your test case as reference; it's essentially
the same test, but using the common regression test facilities. (You'll
have to set UseDeclareFetch=1 in odbc.ini for it to exhibit the bug)

Thanks for the report!

- Heikki


Attachment

pgsql-odbc by date:

Previous
From: Desenvolvimento
Date:
Subject: Re: Bug when performing command SELECT without cast
Next
From: Marco Gaiarin
Date:
Subject: Re: Upgrading by double-clicking the .msi