From f11b0df121ae934e92faaa2ee4907c29bfccd44b Mon Sep 17 00:00:00 2001 From: SherlockNoMad Date: Tue, 15 Mar 2016 10:57:33 -0700 Subject: [PATCH] Fix AppVeyor build error --- CMakeLists.txt | 1 + tools/db_bench_tool.cc | 5 +++-- util/transaction_test_util.h | 1 + utilities/transactions/optimistic_transaction_test.cc | 3 ++- utilities/transactions/transaction_test.cc | 3 ++- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 16219b96f..bfe6531e5 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 4f00375f8..e90bbc490 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 c9885fc5f..97c62841f 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 688f3d11a..fd90f2423 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 f9bb7d96d..f7a1f2ed8 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);