提交 bfc2f142 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!2601 AutoIndexObj should use 0 as the first generated key

Merge pull request !2601 from JesseKLee/auto_index
......@@ -91,7 +91,7 @@ class AutoIndexObj : public BPlusTree<int64_t, T, A> {
}
private:
static constexpr key_type kMinKey = 1;
static constexpr key_type kMinKey = 0;
std::atomic<key_type> inx_;
};
} // namespace dataset
......
......@@ -190,9 +190,9 @@ TEST_F(MindDataTestBPlusTree, Test3) {
EXPECT_TRUE(rc.IsOk());
uint64_t min = ai.min_key();
uint64_t max = ai.max_key();
EXPECT_EQ(min, 1);
EXPECT_EQ(max, 4);
auto r = ai.Search(3);
EXPECT_EQ(min, 0);
EXPECT_EQ(max, 3);
auto r = ai.Search(2);
auto &it = r.first;
EXPECT_EQ(it.value(), "b");
MS_LOG(INFO) << "Dump all the values using [] operator.";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册