Permalink
Browse files

msOGRFileOpen(): reset OGR error after trying to run 'SELECT spatiali…

…te_version()' for SQlite and GPKG input datasets
  • Loading branch information...
rouault committed Mar 6, 2018
1 parent 9297c35 commit 4e4885f8598764b7cfb3a8c1c91c6f60eb12671f
Showing with 2 additions and 0 deletions.
  1. +2 −0 mapogr.cpp
@@ -1333,6 +1333,7 @@ msOGRFileOpen(layerObj *layer, const char *connection )
}
CPLPopErrorHandler();
CPLErrorReset();
if (have_spatialite)
psInfo->dialect = "Spatialite";
@@ -1378,6 +1379,7 @@ msOGRFileOpen(layerObj *layer, const char *connection )
OGR_DS_ReleaseResultSet(hDS, l);
}
CPLPopErrorHandler();
CPLErrorReset();
if( have_gpkg_spatialite )
{

2 comments on commit 4e4885f

@geographika

This comment has been minimized.

Contributor

geographika replied Mar 6, 2018

@rouault - thanks for this, the OGR error is gone, and the image can be successfully created.

Just to note, I built both MapServer and GDAL from source and applied this patch. Interestingly the error is also gone without the above patch when using GDAL master - (2.3.0dev 2017/99/99).
When reverting back to GDAL 2.2.3 (released 2017/11/20) the MapServer OGR error reappears unless the above patch is used. I assume something changed with the CPLPopErrorHandler between 2.2.3 and 2.3.0?

@rouault

This comment has been minimized.

Contributor

rouault replied Mar 6, 2018

I assume something changed with the CPLPopErrorHandler between 2.2.3 and 2.3.0?

No, but likely in the GPKG driver we call CPLErrorReset() now

Please sign in to comment.