AutoIndexObj primary should start with 0

pull/2601/head
Jesse Lee 5 years ago
parent c6c5fa8406
commit 81bf4bde1d

@ -91,7 +91,7 @@ class AutoIndexObj : public BPlusTree<int64_t, T, A> {
} }
private: private:
static constexpr key_type kMinKey = 1; static constexpr key_type kMinKey = 0;
std::atomic<key_type> inx_; std::atomic<key_type> inx_;
}; };
} // namespace dataset } // namespace dataset

@ -190,9 +190,9 @@ TEST_F(MindDataTestBPlusTree, Test3) {
EXPECT_TRUE(rc.IsOk()); EXPECT_TRUE(rc.IsOk());
uint64_t min = ai.min_key(); uint64_t min = ai.min_key();
uint64_t max = ai.max_key(); uint64_t max = ai.max_key();
EXPECT_EQ(min, 1); EXPECT_EQ(min, 0);
EXPECT_EQ(max, 4); EXPECT_EQ(max, 3);
auto r = ai.Search(3); auto r = ai.Search(2);
auto &it = r.first; auto &it = r.first;
EXPECT_EQ(it.value(), "b"); EXPECT_EQ(it.value(), "b");
MS_LOG(INFO) << "Dump all the values using [] operator."; MS_LOG(INFO) << "Dump all the values using [] operator.";

Loading…
Cancel
Save