From 8abd41a54413751748c1a62397002483e0a001e2 Mon Sep 17 00:00:00 2001 From: Burton Li Date: Fri, 27 Mar 2020 11:10:12 -0700 Subject: [PATCH] Fix write_unprepared_transaction_test crash on debug version. (#6574) Summary: The last key may hit index of out bound exception when id = 9. Pull Request resolved: https://github.com/facebook/rocksdb/pull/6574 Reviewed By: riversand963 Differential Revision: D20699791 Pulled By: cheng-chang fbshipit-source-id: 8e2c5be5ff0e53e9857cfd59cea97cff21446819 --- utilities/transactions/write_unprepared_transaction_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utilities/transactions/write_unprepared_transaction_test.cc b/utilities/transactions/write_unprepared_transaction_test.cc index 8b1613b2e..4ecbfd14f 100644 --- a/utilities/transactions/write_unprepared_transaction_test.cc +++ b/utilities/transactions/write_unprepared_transaction_test.cc @@ -182,8 +182,8 @@ TEST_P(WriteUnpreparedStressTest, ReadYourOwnWriteStress) { ReadOptions read_options; for (uint32_t i = 0; i < kNumIter; i++) { - std::set owned_keys(&keys[id * kNumKeys], - &keys[(id + 1) * kNumKeys]); + std::set owned_keys(keys.begin() + id * kNumKeys, + keys.begin() + (id + 1) * kNumKeys); // Add unowned keys to make the workload more interesting, but this // increases row lock contention, so just do it sometimes. if (rnd.OneIn(2)) {