diff --git a/src/Nethermind/Nethermind.Db.Rocks/DbOnTheRocks.cs b/src/Nethermind/Nethermind.Db.Rocks/DbOnTheRocks.cs index 113c6ae944e..98dc84e3d73 100644 --- a/src/Nethermind/Nethermind.Db.Rocks/DbOnTheRocks.cs +++ b/src/Nethermind/Nethermind.Db.Rocks/DbOnTheRocks.cs @@ -514,17 +514,17 @@ internal void SetWithColumnFamily(ReadOnlySpan key, ColumnFamilyHandle? cf public WriteOptions? WriteFlagsToWriteOptions(WriteFlags flags) { - if ((flags & WriteFlags.LowPriorityAndNoWAL) != 0) + if ((flags & WriteFlags.LowPriorityAndNoWAL) == WriteFlags.LowPriorityAndNoWAL) { return _lowPriorityAndNoWalWrite; } - if ((flags & WriteFlags.DisableWAL) != 0) + if ((flags & WriteFlags.DisableWAL) == WriteFlags.DisableWAL) { return _noWalWrite; } - if ((flags & WriteFlags.LowPriority) != 0) + if ((flags & WriteFlags.LowPriority) == WriteFlags.LowPriority) { return _lowPriorityWriteOptions; } diff --git a/src/Nethermind/Nethermind.Db.Test/DbOnTheRocksTests.cs b/src/Nethermind/Nethermind.Db.Test/DbOnTheRocksTests.cs index 6b7a9587138..36c5864069d 100644 --- a/src/Nethermind/Nethermind.Db.Test/DbOnTheRocksTests.cs +++ b/src/Nethermind/Nethermind.Db.Test/DbOnTheRocksTests.cs @@ -47,13 +47,15 @@ public void WriteOptions_is_correct() WriteOptions? options = db.WriteFlagsToWriteOptions(WriteFlags.LowPriority); Native.Instance.rocksdb_writeoptions_get_low_pri(options.Handle).Should().BeTrue(); + Native.Instance.rocksdb_writeoptions_get_disable_WAL(options.Handle).Should().BeFalse(); options = db.WriteFlagsToWriteOptions(WriteFlags.LowPriority | WriteFlags.DisableWAL); Native.Instance.rocksdb_writeoptions_get_low_pri(options.Handle).Should().BeTrue(); - Native.Instance.rocksdb_writeoptions_get_disable_WAL(options.Handle).Should().Be(true); + Native.Instance.rocksdb_writeoptions_get_disable_WAL(options.Handle).Should().BeTrue(); options = db.WriteFlagsToWriteOptions(WriteFlags.DisableWAL); - Native.Instance.rocksdb_writeoptions_get_disable_WAL(options.Handle).Should().Be(true); + Native.Instance.rocksdb_writeoptions_get_low_pri(options.Handle).Should().BeFalse(); + Native.Instance.rocksdb_writeoptions_get_disable_WAL(options.Handle).Should().BeTrue(); } [Test]