Add a cell to the current leaf page. For table leaves: varint(payload_len) + varint(rowid) + payload For index leaves: varint(payload_len) + payload
| 650 | // For table leaves: varint(payload_len) + varint(rowid) + payload |
| 651 | // For index leaves: varint(payload_len) + payload |
| 652 | static void pb_add_cell(PageBuilder *pb, const uint8_t *cell, int cell_len) { |
| 653 | // Write cell content (grows down) |
| 654 | pb->content_offset -= cell_len; |
| 655 | memcpy(pb->page + pb->content_offset, cell, cell_len); |
| 656 | |
| 657 | // Write cell pointer (grows up) |
| 658 | put_u16(pb->page + pb->ptr_offset, (uint16_t)pb->content_offset); |
| 659 | pb->ptr_offset += CELL_PTR_SIZE; |
| 660 | pb->cell_count++; |
| 661 | } |
| 662 | |
| 663 | // Build interior pages from child page references. |
| 664 | // Returns the root page number. |
no test coverage detected