diff --git a/include/rocksdb/metadata.h b/include/rocksdb/metadata.h index 37e7b50b9..f6be889ba 100644 --- a/include/rocksdb/metadata.h +++ b/include/rocksdb/metadata.h @@ -20,7 +20,7 @@ struct SstFileMetaData; // The metadata that describes a column family. struct ColumnFamilyMetaData { - ColumnFamilyMetaData() : size(0), name("") {} + ColumnFamilyMetaData() : size(0), file_count(0), name("") {} ColumnFamilyMetaData(const std::string& _name, uint64_t _size, const std::vector&& _levels) : size(_size), name(_name), levels(_levels) {} @@ -54,7 +54,16 @@ struct LevelMetaData { // The metadata that describes a SST file. struct SstFileMetaData { - SstFileMetaData() {} + SstFileMetaData() + : size(0), + name(""), + db_path(""), + smallest_seqno(0), + largest_seqno(0), + smallestkey(""), + largestkey(""), + num_reads_sampled(0), + being_compacted(false) {} SstFileMetaData(const std::string& _file_name, const std::string& _path, uint64_t _size, SequenceNumber _smallest_seqno, SequenceNumber _largest_seqno, diff --git a/include/rocksdb/sst_file_writer.h b/include/rocksdb/sst_file_writer.h index 04d5c271a..15e89cd67 100644 --- a/include/rocksdb/sst_file_writer.h +++ b/include/rocksdb/sst_file_writer.h @@ -28,7 +28,15 @@ class Comparator; // ExternalSstFileInfo include information about sst files created // using SstFileWriter. struct ExternalSstFileInfo { - ExternalSstFileInfo() {} + ExternalSstFileInfo() + : file_path(""), + smallest_key(""), + largest_key(""), + sequence_number(0), + file_size(0), + num_entries(0), + version(0) {} + ExternalSstFileInfo(const std::string& _file_path, const std::string& _smallest_key, const std::string& _largest_key, diff --git a/include/rocksdb/utilities/transaction.h b/include/rocksdb/utilities/transaction.h index aa00dffa9..8317ce4ac 100644 --- a/include/rocksdb/utilities/transaction.h +++ b/include/rocksdb/utilities/transaction.h @@ -470,7 +470,7 @@ class Transaction { protected: explicit Transaction(const TransactionDB* db) {} - Transaction() {} + Transaction() : log_number_(0), txn_state_(STARTED) {} // the log in which the prepared section for this txn resides // (for two phase commit)