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:
dennis zhuang
2024-12-09 11:27:46 +08:00
committed by GitHub
parent c0f498b00c
commit 903da8f4cb
3 changed files with 108 additions and 87 deletions

View File

@@ -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
}