Opened 17 years ago
Last modified 17 years ago
#1514 closed defect (fixed)
Query results not cleaned in Soft Transactions of PG
Reported by: | Mateusz Łoskot | Owned by: | Mateusz Łoskot |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | OGR_SF | Version: | 1.4.0 |
Severity: | major | Keywords: | |
Cc: |
Description (last modified by )
In functions operating on Soft Transactions, query results are not properly released when error occur. Is it intentional?
For example, in OGRPGDataSource::SoftRollback()
hResult = PQexec(hPGConn, "ROLLBACK"); if( !hResult || PQresultStatus(hResult) != PGRES_COMMAND_OK ) return OGRERR_FAILURE; PQclear( hResult );
The PQclear() call is missing before return OGRERR_FAILURE.
Change History (4)
comment:2 by , 17 years ago
The bug has been fixed. Here is detailed changeset: http://trac.osgeo.org/gdal/changeset/10931 Along refactoring, new file has been added - ogrpgutility.h - with inline free function OGRPGClearResult() which is a simple and safe wrapper on PQclear() http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrsf_frmts/pg/ogrpgutility.h Everything builds locally and on Buildbot. All autotests pass. Manually executed tests using ogrinfo pass, without any complains from Valgrind.
comment:4 by , 17 years ago
Description: | modified (diff) |
---|
Note:
See TracTickets
for help on using tickets.