diff --git a/CMakeLists.txt b/CMakeLists.txt index 16219b96f4..bfe6531e52 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -238,6 +238,7 @@ set(SOURCES util/thread_status_updater.cc util/thread_status_util.cc util/thread_status_util_debug.cc + util/transaction_test_util.cc util/xfunc.cc util/xxhash.cc utilities/backupable/backupable_db.cc diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index 4f00375f80..e90bbc4904 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -3764,7 +3764,7 @@ class Benchmark { ReadOptions options(FLAGS_verify_checksum, true); Duration duration(FLAGS_duration, readwrites_); ReadOptions read_options(FLAGS_verify_checksum, true); - uint64_t num_prefix_ranges = FLAGS_transaction_sets; + uint16_t num_prefix_ranges = static_cast(FLAGS_transaction_sets); uint64_t transactions_done = 0; if (num_prefix_ranges == 0 || num_prefix_ranges > 9999) { @@ -3836,7 +3836,8 @@ class Benchmark { } Status s = - RandomTransactionInserter::Verify(db_.db, FLAGS_transaction_sets); + RandomTransactionInserter::Verify(db_.db, + static_cast(FLAGS_transaction_sets)); if (s.ok()) { fprintf(stdout, "RandomTransactionVerify Success.\n"); diff --git a/util/transaction_test_util.h b/util/transaction_test_util.h index c9885fc5f0..97c62841f5 100644 --- a/util/transaction_test_util.h +++ b/util/transaction_test_util.h @@ -8,6 +8,7 @@ #ifndef ROCKSDB_LITE #include "rocksdb/options.h" +#include "port/port.h" #include "rocksdb/utilities/optimistic_transaction_db.h" #include "rocksdb/utilities/transaction_db.h" diff --git a/utilities/transactions/optimistic_transaction_test.cc b/utilities/transactions/optimistic_transaction_test.cc index 688f3d11a3..fd90f24234 100644 --- a/utilities/transactions/optimistic_transaction_test.cc +++ b/utilities/transactions/optimistic_transaction_test.cc @@ -1284,7 +1284,8 @@ Status OptimisticTransactionStressTestInserter(OptimisticTransactionDB* db, txn_options.set_snapshot = true; RandomTransactionInserter inserter(&_rand, write_options, read_options, - num_keys_per_set, num_sets); + num_keys_per_set, + static_cast(num_sets)); for (size_t t = 0; t < num_transactions; t++) { bool success = inserter.OptimisticTransactionDBInsert(db, txn_options); diff --git a/utilities/transactions/transaction_test.cc b/utilities/transactions/transaction_test.cc index f9bb7d96d6..f7a1f2ed83 100644 --- a/utilities/transactions/transaction_test.cc +++ b/utilities/transactions/transaction_test.cc @@ -2996,7 +2996,8 @@ Status TransactionStressTestInserter(TransactionDB* db, txn_options.set_snapshot = true; RandomTransactionInserter inserter(&_rand, write_options, read_options, - num_keys_per_set, num_sets); + num_keys_per_set, + static_cast(num_sets)); for (size_t t = 0; t < num_transactions; t++) { bool success = inserter.TransactionDBInsert(db, txn_options);