Skip to content

Commit 3756d2a

Browse files
authored
Merge pull request cstack#18 from sairoutine/fix_uninitialized_root_page_num
fix uninitialized root_page_num
2 parents e9ba556 + 01c077c commit 3756d2a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

db.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@ Table* db_open(const char* filename) {
498498

499499
Table* table = malloc(sizeof(Table));
500500
table->pager = pager;
501+
table->root_page_num = 0;
501502

502503
if (pager->num_pages == 0) {
503504
// New database file. Initialize page 0 as leaf node.

0 commit comments

Comments
 (0)