Skip to content

Commit

Permalink
Merge pull request #9164 from OSGeo/backport-9161-to-release/3.8
Browse files Browse the repository at this point in the history
[Backport release/3.8] PAM only unset GPF_DIRTY flag
  • Loading branch information
rouault authored Jan 30, 2024
2 parents e168329 + 1038b98 commit d445e97
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion frmts/exr/exrdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ GDALDataset *GDALEXRDataset::Open(GDALOpenInfo *poOpenInfo)
poDS->SetMetadata(aosSubDS.List(), "SUBDATASETS");
}

poDS->SetPamFlags(0);
poDS->SetPamFlags(poDS->GetPamFlags() & ~GPF_DIRTY);

// Initialize any PAM information.
poDS->SetDescription(poOpenInfo->pszFilename);
Expand Down
2 changes: 1 addition & 1 deletion frmts/plmosaic/plmosaicdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ GDALDataset *PLMosaicDataset::Open(GDALOpenInfo *poOpenInfo)
}

if (poDS)
poDS->SetPamFlags(0);
poDS->SetPamFlags(poDS->GetPamFlags() & ~GPF_DIRTY);

return poDS;
}
Expand Down
2 changes: 1 addition & 1 deletion frmts/wmts/wmtsdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2456,7 +2456,7 @@ GDALDataset *WMTSDataset::Open(GDALOpenInfo *poOpenInfo)

CPLDestroyXMLNode(psXML);

poDS->SetPamFlags(0);
poDS->SetPamFlags(poDS->GetPamFlags() & ~GPF_DIRTY);
return poDS;
}
/************************************************************************/
Expand Down
10 changes: 5 additions & 5 deletions ogr/ogrsf_frmts/gpkg/ogrgeopackagedatasource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1904,7 +1904,7 @@ int GDALGeoPackageDataset::Open(GDALOpenInfo *poOpenInfo,
FixupWrongMedataReferenceColumnNameUpdate();
}

SetPamFlags(0);
SetPamFlags(GetPamFlags() & ~GPF_DIRTY);

return bRet;
}
Expand Down Expand Up @@ -3395,7 +3395,7 @@ CPLErr GDALGeoPackageDataset::FlushCache(bool bAtClosing)

if (eAccess == GA_Update || !m_bMetadataDirty)
{
SetPamFlags(0);
SetPamFlags(GetPamFlags() & ~GPF_DIRTY);
}

if (m_bRemoveOGREmptyTable)
Expand All @@ -3413,7 +3413,7 @@ CPLErr GDALGeoPackageDataset::FlushCache(bool bAtClosing)
// Needed again as above IFlushCacheWithErrCode()
// may have call GDALGeoPackageRasterBand::InvalidateStatistics()
// which modifies metadata
SetPamFlags(0);
SetPamFlags(GetPamFlags() & ~GPF_DIRTY);
}

return eErr;
Expand Down Expand Up @@ -6031,7 +6031,7 @@ GDALDataset *GDALGeoPackageDataset::CreateCopy(const char *pszFilename,
}
}
if (poDS)
poDS->SetPamFlags(0);
poDS->SetPamFlags(poDS->GetPamFlags() & ~GPF_DIRTY);
return poDS;
}

Expand Down Expand Up @@ -6411,7 +6411,7 @@ GDALDataset *GDALGeoPackageDataset::CreateCopy(const char *pszFilename,
GDALDestroyWarpOptions(psWO);

if (poDS)
poDS->SetPamFlags(0);
poDS->SetPamFlags(poDS->GetPamFlags() & ~GPF_DIRTY);

return poDS;
}
Expand Down

0 comments on commit d445e97

Please sign in to comment.