Skip to content

Commit 7bf7ee5

Browse files
committed
Fix macro + RocksDB bug
1 parent 7cf9cdc commit 7bf7ee5

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

cloud/cloud_env.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void BucketOptions::TEST_Initialize(const std::string& bucket,
7171
if (!CloudEnvOptions::GetNameFromEnvironment("ROCKSDB_CLOUD_TEST_BUCKET_NAME",
7272
"ROCKSDB_CLOUD_BUCKET_NAME",
7373
&bucket_)) {
74-
#ifdef _MSC_VER
74+
#ifdef _WIN32_WINNT
7575
char user_name[257]; // UNLEN + 1
7676
DWORD dwsize = sizeof(user_name);
7777
if (!::GetUserName(user_name, &dwsize)) {

table/block_based/block_based_table_reader.cc

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3966,8 +3966,12 @@ uint64_t BlockBasedTable::ApproximateOffsetOf(const Slice& key,
39663966
TableReaderCaller caller) {
39673967
BlockCacheLookupContext context(caller);
39683968
IndexBlockIter iiter_on_stack;
3969+
3970+
ReadOptions ro;
3971+
ro.total_order_seek = true;
3972+
39693973
auto index_iter =
3970-
NewIndexIterator(ReadOptions(), /*disable_prefix_seek=*/false,
3974+
NewIndexIterator(ro, /*disable_prefix_seek=*/false,
39713975
/*input_iter=*/&iiter_on_stack, /*get_context=*/nullptr,
39723976
/*lookup_context=*/&context);
39733977
std::unique_ptr<InternalIteratorBase<IndexValue>> iiter_unique_ptr;
@@ -3985,8 +3989,12 @@ uint64_t BlockBasedTable::ApproximateSize(const Slice& start, const Slice& end,
39853989

39863990
BlockCacheLookupContext context(caller);
39873991
IndexBlockIter iiter_on_stack;
3992+
3993+
ReadOptions ro;
3994+
ro.total_order_seek = true;
3995+
39883996
auto index_iter =
3989-
NewIndexIterator(ReadOptions(), /*disable_prefix_seek=*/false,
3997+
NewIndexIterator(ro, /*disable_prefix_seek=*/false,
39903998
/*input_iter=*/&iiter_on_stack, /*get_context=*/nullptr,
39913999
/*lookup_context=*/&context);
39924000
std::unique_ptr<InternalIteratorBase<IndexValue>> iiter_unique_ptr;

0 commit comments

Comments
 (0)