fix copy wal to page buffer problem

Signed-off-by: shipixian <shipixian_yewu@cmss.chinamobile.com>
This commit is contained in:
shipixian 2023-03-29 14:48:51 +08:00
parent db6852aba8
commit 5f78ab89aa

View File

@ -788,7 +788,8 @@ he3db_mdread_pagexlog(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknu
Assert(result.count != 0);
nbytes += result.count;
*buffer = (uint8_t *)realloc(*buffer, BLCKSZ + result.count);
strcat(*buffer,result.buf);
// strcat(*buffer,result.buf);
memcpy(*buffer+BLCKSZ, result.buf, result.count);
free_dataRead(result.buf, result.count, result.cap);
}
//TODO free result
@ -843,7 +844,8 @@ he3db_mdread_pagexlog(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknu
Assert(result.count != 0);
nbytes += result.count;
buf = (uint8_t *)realloc(buf, BLCKSZ + result.count);
strcat(buf,result.buf);
// strcat(buf,result.buf);
memcpy(buf+BLCKSZ, result.buf, result.count);
//TODO free result
free_dataRead(result.buf, result.count, result.cap);
}