You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After implementing B-tree, each node occupies exactly one page of the table, so there is no need to test whether db file is a whole number of pages in pager_open function.
Pager*pager_open(constchar*filename) {
.............
off_tfile_length=lseek(fd, 0, SEEK_END);
Pager*pager=malloc(sizeof(Pager));
pager->file_descriptor=fd;
pager->file_length=file_length;
pager->num_pages= (file_length / PAGE_SIZE);
// if (file_length % PAGE_SIZE != 0) {// printf("Db file is not a whole number of pages. Corrupt file.\n");// exit(EXIT_FAILURE);// }for (uint32_ti=0; i<TABLE_MAX_PAGES; i++) {
pager->pages[i] =NULL;
}
The text was updated successfully, but these errors were encountered:
After implementing B-tree, each node occupies exactly one page of the table, so there is no need to test whether db file is a whole number of pages in
pager_open
function.The text was updated successfully, but these errors were encountered: