ctl: validate column family name when scanning data using ctl
* ctl: should check column name validation when scan data using ctl
close
* fix format problem
@@ -14,7 +14,7 @@ use engine_rocks::raw_util::{db_exist, new_engine_opt};
use engine_rocks::RocksEngine;
use engine_traits::{
EncryptionKeyManager, Engines, Error as EngineError, RaftEngine, ALL_CFS, CF_DEFAULT, CF_LOCK,
- CF_WRITE,
+ CF_WRITE, DATA_CFS,
};
use file_system::calc_crc32;
use futures::{executor::block_on, future, stream, Stream, StreamExt, TryStreamExt};
@@ -331,6 +331,13 @@ trait DebugExecutor {
process::exit(-1);
}
+ cfs.iter().for_each(|cf| {
+ if !DATA_CFS.contains(cf) {
+ eprintln!("CF \"{}\" doesn't exist.", cf);
+ process::exit(-1);
+ }
+ });
+
let point_query = to.is_empty() && limit == 0;
if point_query {
limit = 1;
