bustub icon indicating copy to clipboard operation
bustub copied to clipboard

question about project3 delete test

Open iiiuwioajdks opened this issue 2 years ago • 1 comments

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());
}

iiiuwioajdks avatar May 21 '22 12:05 iiiuwioajdks

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).

minhdang26403 avatar Jun 28 '22 15:06 minhdang26403