sf_file_writer_get_binlog_indexes ignore file not exist
parent
bcd1120617
commit
1d1d4c9f00
|
|
@ -263,6 +263,11 @@ static inline SFBinlogWriterBuffer *sf_binlog_writer_alloc_versioned_buffer_ex(
|
|||
sf_file_writer_get_index_filename(data_path, \
|
||||
subdir_name, filename, size)
|
||||
|
||||
#define sf_binlog_writer_get_binlog_indexes(data_path, \
|
||||
subdir_name, start_index, last_index) \
|
||||
sf_file_writer_get_binlog_indexes(data_path, \
|
||||
subdir_name, start_index, last_index)
|
||||
|
||||
#define sf_binlog_writer_get_binlog_start_index(data_path, \
|
||||
subdir_name, start_index) \
|
||||
sf_file_writer_get_binlog_start_index(data_path, \
|
||||
|
|
|
|||
|
|
@ -125,9 +125,17 @@ static int get_binlog_info_from_file(const char *data_path,
|
|||
int sf_file_writer_get_binlog_indexes(const char *data_path,
|
||||
const char *subdir_name, int *start_index, int *last_index)
|
||||
{
|
||||
int result;
|
||||
int compress_index;
|
||||
return get_binlog_info_from_file(data_path, subdir_name,
|
||||
|
||||
result = get_binlog_info_from_file(data_path, subdir_name,
|
||||
start_index, last_index, &compress_index);
|
||||
if (result == ENOENT) {
|
||||
*start_index = *last_index = 0;
|
||||
return 0;
|
||||
} else {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
static inline int get_binlog_index_from_file(SFFileWriterInfo *writer)
|
||||
|
|
@ -146,9 +154,10 @@ static inline int get_binlog_index_from_file(SFFileWriterInfo *writer)
|
|||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
static int open_writable_binlog(SFFileWriterInfo *writer)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue