mdbx: fix merge_sync_flags() to preserve MDBX_UTTERLY_NOSYNC.

Change-Id: I59dbd1ef8ac1747dd20565ff444e4feb5d0e0e71
This commit is contained in:
Leonid Yuriev 2020-09-29 22:15:12 +03:00
parent f6850f5367
commit fc965c57ac

View File

@ -10286,7 +10286,8 @@ static uint32_t merge_sync_flags(const uint32_t a, const uint32_t b) {
/* convert MDBX_DEPRECATED_MAPASYNC to MDBX_SAFE_NOSYNC */
if ((r & (MDBX_WRITEMAP | MDBX_DEPRECATED_MAPASYNC)) ==
(MDBX_WRITEMAP | MDBX_DEPRECATED_MAPASYNC))
(MDBX_WRITEMAP | MDBX_DEPRECATED_MAPASYNC) &&
!F_ISSET(r, MDBX_UTTERLY_NOSYNC))
r = (r - MDBX_DEPRECATED_MAPASYNC) | MDBX_SAFE_NOSYNC;
/* force MDBX_NOMETASYNC if MDBX_SAFE_NOSYNC enabled */