Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#6194 closed defect (fixed)

Pg data source does not report error message in some cases

Reported by: Ari Jolma Owned by: warmerdam
Priority: normal Milestone: 2.0.2
Component: OGR_SF Version: 2.0.0
Severity: normal Keywords: pg
Cc:

Description

I have SQL

select "geom" as "geometryProperty","id" as "gml_id","pass" as "pass","usern" as "usern" from "test_auth" where ST_IsValid("geom") AND ((("user" = 'me') AND ("pass" = 'pass')) AND (geom && ST_MakeEnvelope(0,0,5,5)))

which, when given to ExecuteSQL lead to SoftStartTransaction... block of code in ogrpgdatasource.cpp. This SQL is flawed and leads to error but the SoftRollbackTransaction(); removes the error and it is not available any more below where the code tries to access it. The CPLError needs to be called before SoftRollbackTransaction();

Change History (3)

comment:1 by Even Rouault, 8 years ago

Keywords: pg added
Milestone: 2.0.2
Resolution: fixed
Status: newclosed
Version: unspecified2.0.0

trunk r31319, branches/2.0 r31320 "PG: avoid reseting error potentially emitted by ExecuteSQL() (#6194)"

comment:2 by Ari Jolma, 8 years ago

I would have expected that we keep the call to set the error message but call it before SoftRollbackTransaction.

However, the error text seems to be emitted. I'm confused. Why that happens?

Version 0, edited 8 years ago by Ari Jolma (next)

comment:3 by Even Rouault, 8 years ago

The error message is directly emitted by OGRPG_PQexec(). Previously there was no wrapper so each time code was necessary to emit a CPLError().

Note: See TracTickets for help on using tickets.