cmu-db / bustub

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

fix memory leak of vector type #692

Closed skyzh closed 7 months ago

skyzh commented 7 months ago

backport from https://github.com/skyzh/bustub-vectordb/pull/1 @UnpureRationalist


Hi there,

Thanks for your excellent tutotial for vector database beginners. When I follow your tutorial and test my implementions using the commands here, memory leak was reported by AddressSanitizer.

After debugging, I found the destructor of class Value was not implemented well for VECTOR type. So this PR fixed the bug by modifying destructor along with the copy constructor (The copy assignment operator do not need to change since it is pass by value).

After fixing the bug, the test can passed correctly without memory leak.