Skip to content

Commit

Permalink
Merge pull request #1379 from OSGeo/backport-1378-on-release/2.4
Browse files Browse the repository at this point in the history
Backport #1378 on release/2.4
  • Loading branch information
rouault authored Mar 20, 2019
2 parents 318629f + bdab2ff commit 67b28fb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gdal/ogr/ogrsf_frmts/gpkg/gdalgeopackagerasterband.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,14 @@ GByte* GDALGPKGMBTilesLikePseudoDataset::ReadTile( int nRow, int nCol, GByte *pa
VSIUnlink(osMemFileName);
sqlite3_finalize(hStmt);
}
else if( rc == SQLITE_BUSY )
{
FillEmptyTile(pabyData);
CPLError( CE_Failure, CPLE_AppDefined, "sqlite3_step(%s) failed (SQLITE_BUSY): %s",
sqlite3_sql( hStmt ), sqlite3_errmsg( IGetDB() ) );
sqlite3_finalize(hStmt);
return pabyData;
}
else
{
sqlite3_finalize( hStmt );
Expand Down
5 changes: 5 additions & 0 deletions gdal/ogr/ogrsf_frmts/sqlite/ogrsqlitedatasource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,11 @@ int OGRSQLiteBaseDataSource::OpenOrCreateDB(int flagsIn, int bRegisterOGR2SQLite
return FALSE;
}

const char* pszVal = CPLGetConfigOption("SQLITE_BUSY_TIMEOUT", "5000");
if ( pszVal != nullptr ) {
sqlite3_busy_timeout(hDB, atoi(pszVal));
}

if( (flagsIn & SQLITE_OPEN_CREATE) == 0 )
{
if( CPLTestBool(CPLGetConfigOption("OGR_VFK_DB_READ", "NO")) )
Expand Down

0 comments on commit 67b28fb

Please sign in to comment.