Skip to content
Permalink
Browse files

[GDAL provider] Fix opening of GeoPackage datasets with foreign key v…

…iolation
  • Loading branch information
rouault committed May 6, 2019
1 parent 477b05d commit e6d220dc26c87464b07da8aa1b03b3b97f85e31a
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/providers/gdal/qgsgdalproviderbase.cpp
@@ -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;
}

0 comments on commit e6d220d

Please sign in to comment.
You can’t perform that action at this time.