Fix page data was not copied during clone

master
Yury Kurlykov 2019-10-31 03:38:28 +10:00
parent 81a23135c4
commit a0fb9e6a63
1 changed files with 2 additions and 0 deletions

View File

@ -118,6 +118,8 @@ void ydb_page_row_count_set(YDB_TablePage *page, YDB_PageSize row_count) {
YDB_TablePage *ydb_page_clone(const YDB_TablePage *page) { YDB_TablePage *ydb_page_clone(const YDB_TablePage *page) {
YDB_TablePage* result = malloc(sizeof(YDB_TablePage)); YDB_TablePage* result = malloc(sizeof(YDB_TablePage));
memcpy(result, page, sizeof(YDB_TablePage)); memcpy(result, page, sizeof(YDB_TablePage));
result->data = malloc(result->size);
memcpy(result->data, page->data, result->size);
return result; return result;
} }