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 ce48a2c commit 23e5a1fdb331c70cc90879afbc50c8d0b1a639c7
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 23e5a1f

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