Skip to content

Commit 276527d

Browse files
committed
chore(cubestore): Upgrade DF: Parse SQL in Cubestore with string literal backslash escapes
1 parent d20f7d8 commit 276527d

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

rust/cubestore/cubestore/src/sql/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,8 @@ pub fn fully_qualified_or_lower(ident: &Ident) -> String {
511511
pub struct MySqlDialectWithBackTicks {}
512512

513513
impl Dialect for MySqlDialectWithBackTicks {
514+
// TODO upgrade DF: There are unimplemented functions as of sqlparser 0.50.0.
515+
514516
fn is_delimited_identifier_start(&self, ch: char) -> bool {
515517
ch == '"' || ch == '`'
516518
}
@@ -529,6 +531,11 @@ impl Dialect for MySqlDialectWithBackTicks {
529531
fn is_identifier_part(&self, ch: char) -> bool {
530532
self.is_identifier_start(ch) || (ch >= '0' && ch <= '9')
531533
}
534+
535+
// Behavior we previously had hard-coded into sqlparser
536+
fn supports_string_literal_backslash_escape(&self) -> bool {
537+
true
538+
}
532539
}
533540

534541
#[async_trait]

rust/cubestore/cubestore/src/sql/parser.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ impl Dialect for MySqlDialectWithBackTicks {
2727
fn is_identifier_part(&self, ch: char) -> bool {
2828
self.is_identifier_start(ch) || (ch >= '0' && ch <= '9')
2929
}
30+
31+
// Behavior we previously had hard-coded into sqlparser
32+
fn supports_string_literal_backslash_escape(&self) -> bool {
33+
true
34+
}
3035
}
3136

3237
#[derive(Debug, Clone, PartialEq)]

0 commit comments

Comments
 (0)