Merge pull request #656 from qinzuoyan/fb-master
fix append bug in DumpDBFileSummary()
This commit is contained in:
commit
aede5cd8e6
@ -62,10 +62,10 @@ void DumpDBFileSummary(const DBOptions& options, const std::string& dbname) {
|
|||||||
break;
|
break;
|
||||||
case kLogFile:
|
case kLogFile:
|
||||||
env->GetFileSize(dbname + "/" + file, &file_size);
|
env->GetFileSize(dbname + "/" + file, &file_size);
|
||||||
char str[8];
|
char str[16];
|
||||||
snprintf(str, sizeof(str), "%" PRIu64, file_size);
|
snprintf(str, sizeof(str), "%" PRIu64, file_size);
|
||||||
wal_info.append(file).append(" size: ").
|
wal_info.append(file).append(" size: ").
|
||||||
append(str, sizeof(str)).append(" ;");
|
append(str).append(" ; ");
|
||||||
break;
|
break;
|
||||||
case kTableFile:
|
case kTableFile:
|
||||||
if (++file_num < 10) {
|
if (++file_num < 10) {
|
||||||
@ -115,10 +115,10 @@ void DumpDBFileSummary(const DBOptions& options, const std::string& dbname) {
|
|||||||
if (ParseFileName(file, &number, &type)) {
|
if (ParseFileName(file, &number, &type)) {
|
||||||
if (type == kLogFile) {
|
if (type == kLogFile) {
|
||||||
env->GetFileSize(options.wal_dir + "/" + file, &file_size);
|
env->GetFileSize(options.wal_dir + "/" + file, &file_size);
|
||||||
char str[8];
|
char str[16];
|
||||||
snprintf(str, sizeof(str), "%" PRIu64, file_size);
|
snprintf(str, sizeof(str), "%" PRIu64, file_size);
|
||||||
wal_info.append(file).append(" size: ").
|
wal_info.append(file).append(" size: ").
|
||||||
append(str, sizeof(str)).append(" ;");
|
append(str).append(" ; ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user