mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-20 15:00:40 +00:00
fix: show create table doesn't quote option keys which contains dot (#5108)
* fix: show create table doesn't quote option keys which contains dot * fix: compile
This commit is contained in:
@@ -79,10 +79,18 @@ impl OptionMap {
|
||||
pub fn kv_pairs(&self) -> Vec<String> {
|
||||
let mut result = Vec::with_capacity(self.options.len() + self.secrets.len());
|
||||
for (k, v) in self.options.iter() {
|
||||
result.push(format!("{k} = '{}'", v.escape_default()));
|
||||
if k.contains(".") {
|
||||
result.push(format!("'{k}' = '{}'", v.escape_default()));
|
||||
} else {
|
||||
result.push(format!("{k} = '{}'", v.escape_default()));
|
||||
}
|
||||
}
|
||||
for (k, _) in self.secrets.iter() {
|
||||
result.push(format!("{k} = '******'"));
|
||||
if k.contains(".") {
|
||||
result.push(format!("'{k}' = '******'"));
|
||||
} else {
|
||||
result.push(format!("{k} = '******'"));
|
||||
}
|
||||
}
|
||||
result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user