Respect deprecated flag in table options

Summary: Closes https://github.com/facebook/rocksdb/pull/2197

Differential Revision: D4932434

Pulled By: maysamyabandeh

fbshipit-source-id: 6c83c12d6d47e3f0640ab84954944215968f266f
This commit is contained in:
Maysam Yabandeh 2017-04-21 17:30:30 -07:00 committed by Facebook Github Bot
parent 066cfbacc0
commit afff9951e2
1 changed files with 5 additions and 3 deletions

View File

@ -1032,7 +1032,8 @@ std::string ParseBlockBasedTableOption(const std::string& name,
return "Unrecognized option";
}
const auto& opt_info = iter->second;
if (!ParseOptionHelper(reinterpret_cast<char*>(new_options) + opt_info.offset,
if (opt_info.verification != OptionVerificationType::kDeprecated &&
!ParseOptionHelper(reinterpret_cast<char*>(new_options) + opt_info.offset,
opt_info.type, value)) {
return "Invalid value";
}
@ -1041,7 +1042,7 @@ std::string ParseBlockBasedTableOption(const std::string& name,
std::string ParsePlainTableOptions(const std::string& name,
const std::string& org_value,
PlainTableOptions* new_option,
PlainTableOptions* new_options,
bool input_strings_escaped = false) {
const std::string& value =
input_strings_escaped ? UnescapeOptionString(org_value) : org_value;
@ -1050,7 +1051,8 @@ std::string ParsePlainTableOptions(const std::string& name,
return "Unrecognized option";
}
const auto& opt_info = iter->second;
if (!ParseOptionHelper(reinterpret_cast<char*>(new_option) + opt_info.offset,
if (opt_info.verification != OptionVerificationType::kDeprecated &&
!ParseOptionHelper(reinterpret_cast<char*>(new_options) + opt_info.offset,
opt_info.type, value)) {
return "Invalid value";
}