Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[GDAL provider] Fix opening of GeoPackage datasets with foreign key v…
…iolation
  • Loading branch information
rouault committed May 8, 2019
1 parent ce48a2c commit 23e5a1f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/providers/gdal/qgsgdalproviderbase.cpp
Expand Up @@ -261,7 +261,16 @@ QgsRectangle QgsGdalProviderBase::extent( GDALDatasetH gdalDataset )const

GDALDatasetH QgsGdalProviderBase::gdalOpen( const char *pszFilename, GDALAccess eAccess )
{
bool modify_OGR_GPKG_FOREIGN_KEY_CHECK = !CPLGetConfigOption( "OGR_GPKG_FOREIGN_KEY_CHECK", nullptr );
if ( modify_OGR_GPKG_FOREIGN_KEY_CHECK )
{
CPLSetThreadLocalConfigOption( "OGR_GPKG_FOREIGN_KEY_CHECK", "NO" );
}
GDALDatasetH hDS = GDALOpen( pszFilename, eAccess );
if ( modify_OGR_GPKG_FOREIGN_KEY_CHECK )
{
CPLSetThreadLocalConfigOption( "OGR_GPKG_FOREIGN_KEY_CHECK", nullptr );
}
return hDS;
}

Expand Down

0 comments on commit 23e5a1f

Please sign in to comment.