diff --git a/options/options_sanity_check.h b/options/options_sanity_check.h index bfadbdaf2..645a6ce1e 100644 --- a/options/options_sanity_check.h +++ b/options/options_sanity_check.h @@ -29,7 +29,6 @@ static const std::unordered_map static const std::unordered_map sanity_level_cf_options = { {"comparator", kSanityLevelLooselyCompatible}, - {"prefix_extractor", kSanityLevelLooselyCompatible}, {"table_factory", kSanityLevelLooselyCompatible}, {"merge_operator", kSanityLevelLooselyCompatible}}; diff --git a/options/options_test.cc b/options/options_test.cc index f7cf48fe3..60a63147f 100644 --- a/options/options_test.cc +++ b/options/options_test.cc @@ -1462,13 +1462,15 @@ TEST_F(OptionsSanityCheckTest, SanityCheck) { // use same prefix extractor but with different parameter opts.prefix_extractor.reset(NewCappedPrefixTransform(15)); - // expect pass only in kSanityLevelNone - ASSERT_NOK(SanityCheckCFOptions(opts, kSanityLevelLooselyCompatible)); + // expect pass only in kSanityLevelLooselyCompatible + ASSERT_NOK(SanityCheckCFOptions(opts, kSanityLevelExactMatch)); + ASSERT_OK(SanityCheckCFOptions(opts, kSanityLevelLooselyCompatible)); ASSERT_OK(SanityCheckCFOptions(opts, kSanityLevelNone)); // repeat the test with FixedPrefixTransform opts.prefix_extractor.reset(NewFixedPrefixTransform(10)); - ASSERT_NOK(SanityCheckCFOptions(opts, kSanityLevelLooselyCompatible)); + ASSERT_NOK(SanityCheckCFOptions(opts, kSanityLevelExactMatch)); + ASSERT_OK(SanityCheckCFOptions(opts, kSanityLevelLooselyCompatible)); ASSERT_OK(SanityCheckCFOptions(opts, kSanityLevelNone)); // persist the change of prefix_extractor @@ -1477,8 +1479,9 @@ TEST_F(OptionsSanityCheckTest, SanityCheck) { // use same prefix extractor but with different parameter opts.prefix_extractor.reset(NewFixedPrefixTransform(15)); - // expect pass only in kSanityLevelNone - ASSERT_NOK(SanityCheckCFOptions(opts, kSanityLevelLooselyCompatible)); + // expect pass only in kSanityLevelLooselyCompatible + ASSERT_NOK(SanityCheckCFOptions(opts, kSanityLevelExactMatch)); + ASSERT_OK(SanityCheckCFOptions(opts, kSanityLevelLooselyCompatible)); ASSERT_OK(SanityCheckCFOptions(opts, kSanityLevelNone)); // Change prefix extractor from non-nullptr to nullptr diff --git a/utilities/options/options_util_test.cc b/utilities/options/options_util_test.cc index 620c0c547..2075c0566 100644 --- a/utilities/options/options_util_test.cc +++ b/utilities/options/options_util_test.cc @@ -234,7 +234,7 @@ TEST_F(OptionsUtilTest, SanityCheck) { CheckOptionsCompatibility(dbname_, Env::Default(), db_opt, cf_descs)); cf_descs[1].options.prefix_extractor.reset(new DummySliceTransform()); - ASSERT_NOK( + ASSERT_OK( CheckOptionsCompatibility(dbname_, Env::Default(), db_opt, cf_descs)); cf_descs[1].options.prefix_extractor = prefix_extractor;