cmu-db / bustub

The BusTub Relational Database Management System (Educational)
https://15445.courses.cs.cmu.edu/
MIT License
3.83k stars 1.74k forks source link

Question about function MoveHalfTo and MoveAllTo #120

Closed jzeah closed 3 years ago

jzeah commented 3 years ago

bplus_leaf_page and bplus_internal use different signatures for functions MoveHalfTo and MoveAllTo:

void B_PLUS_TREE_LEAF_PAGE_TYPE::MoveHalfTo(BPlusTreeLeafPage *recipient);
void B_PLUS_TREE_LEAF_PAGE_TYPE::MoveAllTo(BPlusTreeLeafPage *recipient) ;
void B_PLUS_TREE_INTERNAL_PAGE_TYPE::MoveHalfTo(BPlusTreeInternalPage *recipient,BufferPoolManager *buffer_pool_manager) ;
void B_PLUS_TREE_INTERNAL_PAGE_TYPE::MoveAllTo(BPlusTreeInternalPage *recipient, const KeyType &middle_key,  BufferPoolManager *buffer_pool_manager) ;

so I am confused about how template parameter is used in function Split and Coalesce.

rickyyx commented 3 years ago

If you are using templated calls, make the parameters match.