Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport #1378 on release/2.4 #1379

Merged
merged 1 commit into from
Mar 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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