db_tutorial icon indicating copy to clipboard operation
db_tutorial copied to clipboard

Test error in Part 10

Open gagachang opened this issue 5 years ago • 3 comments

Hello,

Thanks for your tutorial, it's very awesome. However, when I practiced the part 10, I found some error about test-cases below:

image

And I also found that this sentence, "Need to implement searching an internal node.", does not exist so far. Are there any steps the tutorial misses?

gagachang avatar Jan 05 '20 16:01 gagachang

Hi @gagachang. Have you found how to resolve this? I have the test problem on my mac for part 10. If I insert 14 elements to a table by myself, then the program finishes with a segmentation fault.

juraev avatar Feb 19 '21 18:02 juraev

Hi @gagachang. Have you found how to resolve this? I have the test problem on my mac for part 10. If I insert 14 elements to a table by myself, then the program finishes with a segmentation fault. Hi,I also encountered this problem. debugging found that the loop variable was out of bounds. when you write code like: for (int32_t i = LEAF_NODE_MAX_CELLS; i >= 0; i--) due to the intelligent prompt of IDE,it might becomes for (size_t i = LEAF_NODE_MAX_CELLS; i >= 0; i--), size_t is an unsigned type. When it reaches 0, minus one, it is out of bounds and become super big,so the program finishes with a segmentation fault.

thewangcj avatar Dec 14 '21 11:12 thewangcj

i encountered the same problem,after some debugging,i found some problems in my code: it should be void *destination = leaf_node_cell(destination_node, index_within_node); rather than void *destination = leaf_node_cell(destination, index_within_node);

wtyfpc avatar May 17 '23 23:05 wtyfpc