mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-14 17:23:09 +00:00
fix: quote ident on rendered SQL (#2248)
* fix: quote ident on rendered SQL Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * read quote style from query context Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * update sqlness result Signed-off-by: Ruihang Xia <waynestxia@gmail.com> --------- Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
@@ -57,7 +57,7 @@ pub enum Error {
|
||||
UnsupportedDefaultValue { column_name: String, expr: Expr },
|
||||
|
||||
// Syntax error from sql parser.
|
||||
#[snafu(display("Syntax error, sql: {}, source: {}", sql, source))]
|
||||
#[snafu(display("Syntax error, source: {}, sql: {}", source, sql))]
|
||||
Syntax { sql: String, source: ParserError },
|
||||
|
||||
#[snafu(display("Missing time index constraint"))]
|
||||
|
||||
@@ -130,6 +130,15 @@ pub struct Partitions {
|
||||
pub entries: Vec<PartitionEntry>,
|
||||
}
|
||||
|
||||
impl Partitions {
|
||||
/// set quotes to all [Ident]s from column list
|
||||
pub fn set_quote(&mut self, quote_style: char) {
|
||||
self.column_list
|
||||
.iter_mut()
|
||||
.for_each(|c| c.quote_style = Some(quote_style));
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Clone)]
|
||||
pub struct PartitionEntry {
|
||||
pub name: Ident,
|
||||
|
||||
Reference in New Issue
Block a user