Skip to content

Commit

Permalink
Fixed a crash bug that incorrectly parse deprecated options in option…
Browse files Browse the repository at this point in the history
…s_helper

Summary: Fixed a crash bug that incorrectly parse deprecated options in options_helper

Test Plan:
run db_bench with an old options file with memtable_prefix_bloom_probes
./db_bench --options_file=AN_OLD_OPTIONS_FILE --num=100 --benchmarks=fillseq

Reviewers: sdong, IslamAbdelRahman

Subscribers: andrewkr, dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D59787
  • Loading branch information
yhchiang committed Jun 17, 2016
1 parent cf8adc9 commit 3a2bccc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions util/options_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,8 @@ Status ParseColumnFamilyOption(const std::string& name,
"Unable to parse the specified CF option " + name);
}
const auto& opt_info = iter->second;
if (ParseOptionHelper(
if (opt_info.verification != OptionVerificationType::kDeprecated &&
ParseOptionHelper(
reinterpret_cast<char*>(new_options) + opt_info.offset,
opt_info.type, value)) {
return Status::OK();
Expand Down Expand Up @@ -1037,7 +1038,8 @@ Status ParseDBOption(const std::string& name,
return Status::InvalidArgument("Unrecognized option DBOptions:", name);
}
const auto& opt_info = iter->second;
if (ParseOptionHelper(
if (opt_info.verification != OptionVerificationType::kDeprecated &&
ParseOptionHelper(
reinterpret_cast<char*>(new_options) + opt_info.offset,
opt_info.type, value)) {
return Status::OK();
Expand Down

0 comments on commit 3a2bccc

Please sign in to comment.