bugfix: init pReader->binlog_buff.version/length to 0

pull/484/head
YuQing 2019-12-04 22:59:24 +08:00
parent 01041705ba
commit 22824e5f07
2 changed files with 4 additions and 1 deletions

View File

@ -4,6 +4,7 @@ Version 6.04 2019-12-04
* use get_gzip_command_filename from libfastcommon v1.42
* support compress error log and access log
* disk recovery support multi-threads to speed up
* bugfix: init pReader->binlog_buff.version/length to 0
NOTE: you MUST upgrade libfastcommon to V1.42 or later

View File

@ -2207,6 +2207,8 @@ int storage_reader_init(FDFSStorageBrief *pStorage, StorageBinLogReader *pReader
pReader->sync_row_count = 0;
pReader->last_file_exist = 0;
pReader->binlog_fd = -1;
pReader->binlog_buff.version = 0;
pReader->binlog_buff.length = 0;
pReader->binlog_buff.buffer = (char *)malloc( \
STORAGE_BINLOG_BUFFER_SIZE);
@ -2477,7 +2479,7 @@ static int storage_binlog_preread(StorageBinLogReader *pReader)
int bytes_read;
int saved_binlog_write_version;
if (pReader->binlog_buff.version == binlog_write_version && \
if (pReader->binlog_buff.version == binlog_write_version &&
pReader->binlog_buff.length == 0)
{
return ENOENT;