Add a cell to the current leaf page. For table leaves: varint(payload_len) + varint(rowid) + payload For index leaves: varint(payload_len) + payload
| 534 | // For table leaves: varint(payload_len) + varint(rowid) + payload |
| 535 | // For index leaves: varint(payload_len) + payload |
| 536 | static void pb_add_cell(PageBuilder *pb, const uint8_t *cell, int cell_len) { |
| 537 | // Write cell content (grows down) |
| 538 | pb->content_offset -= cell_len; |
| 539 | memcpy(pb->page + pb->content_offset, cell, cell_len); |
| 540 | |
| 541 | // Write cell pointer (grows up) |
| 542 | put_u16(pb->page + pb->ptr_offset, (uint16_t)pb->content_offset); |
| 543 | pb->ptr_offset += CELL_PTR_SIZE; |
| 544 | pb->cell_count++; |
| 545 | } |
| 546 | |
| 547 | // Build interior pages from child page references. |
| 548 | // Returns the root page number. |
no test coverage detected