From 3a2bccc8451a8b49df9c869144d27bb4a4ce713a Mon Sep 17 00:00:00 2001 From: Yueh-Hsuan Chiang Date: Fri, 17 Jun 2016 04:52:53 -0700 Subject: [PATCH] Fixed a crash bug that incorrectly parse deprecated options in options_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 --- util/options_helper.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/util/options_helper.cc b/util/options_helper.cc index a9f50cb265..7765faad64 100644 --- a/util/options_helper.cc +++ b/util/options_helper.cc @@ -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(new_options) + opt_info.offset, opt_info.type, value)) { return Status::OK(); @@ -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(new_options) + opt_info.offset, opt_info.type, value)) { return Status::OK();