Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ldbcmd cant use custom comparator (#12159)
Summary: According to this [Q&A](https://github.com/facebook/rocksdb/wiki/RocksDB-FAQ#:~:text=Q%3A%20If%20I%20use%20non%2Ddefault%20comparators%20or%20merge%20operators%2C%20can%20I%20still%20use%20ldb%20tool%3F), user should be able to use LDB with passing a customized comparator into the option. In the process of opening DB in order to perform ldb commands, there is a exception saying comparator not match even if a option with customized comparator is provided. After initializing the column family to open DB, the `LDBCommand::OverrideBaseCFOptions` method does not update the comparator inside column family descriptor using the passed in options. This can cause a mismatch while doing version edit, and in function `ToggleUDT CompareComparator` it will failed and return a exception saying comparator not match. Propose fix by updating the column family descriptor's option using the user passed in option. Also a test case is provided to illustrate the steps. Pull Request resolved: #12159 Reviewed By: hx235 Differential Revision: D52267367 Pulled By: ajkr fbshipit-source-id: c240f93f440e02cb485893de058a46c6dbf9654b
- Loading branch information