bustub
bustub copied to clipboard
question about project3 delete test
in test/execution/executor_test.cpp:
TEST_F(ExecutorTest, SimpleDeleteTest) {
...
// DELETE FROM test_1 WHERE col_a == 50
const Tuple index_key = Tuple(result_set[0]);
...
std::vector<RID> rids{};
index_info->index_->ScanKey(index_key, &rids, GetTxn());
ASSERT_TRUE(rids.empty());
}
should we change the test code to:
TEST_F(ExecutorTest, SimpleDeleteTest) {
...
// DELETE FROM test_1 WHERE col_a == 50
const Tuple index_key = result_set[0].KeyFromTuple(schema, *key_schema, std::vector<uint32_t>{0});
...
std::vector<RID> rids{};
index_info->index_->ScanKey(index_key, &rids, GetTxn());
ASSERT_TRUE(rids.empty());
}
Yes, I think we should change the code to get the index_key. This issue was resolved in the issue #195 (https://github.com/cmu-db/bustub/issues/195).