Skip to content

Commit

Permalink
OGR_GPKG_FillArrowArray_Step(): more rigourous locking to perhaps fix…
Browse files Browse the repository at this point in the history
… random failure on ogr_gpkg.py::test_ogr_gpkg_arrow_stream_huge_array[huge_string]
  • Loading branch information
rouault committed Sep 10, 2024
1 parent 91ef2f1 commit 31ddb3c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ogr/ogrsf_frmts/gpkg/ogrgeopackagetablelayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7805,12 +7805,13 @@ void OGR_GPKG_FillArrowArray_Step(sqlite3_context *pContext, int /*argc*/,
const int SQLITE_MAX_FUNCTION_ARG =
sqlite3_limit(psFillArrowArray->hDB, SQLITE_LIMIT_FUNCTION_ARG, -1);
begin:
const int iFeat = [psFillArrowArray]()
int iFeat;
OGRArrowArrayHelper *psHelper;
{
std::unique_lock<std::mutex> oLock(psFillArrowArray->oMutex);
return psFillArrowArray->nCountRows;
}();
auto psHelper = psFillArrowArray->psHelper.get();
iFeat = psFillArrowArray->nCountRows;
psHelper = psFillArrowArray->psHelper.get();
}
int iCol = 0;
const int iFieldStart = sqlite3_value_int(argv[iCol]);
++iCol;
Expand Down

0 comments on commit 31ddb3c

Please sign in to comment.