This is an automated email from the ASF dual-hosted git repository.

iffyio pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion-sqlparser-rs.git


The following commit(s) were added to refs/heads/main by this push:
     new cfd89514 Allow literal backslash escapes for string literals in 
Redshift dialect. (#1801)
cfd89514 is described below

commit cfd8951452b97de7b59afa328a739858e1da6ce3
Author: Roman Borschel <[email protected]>
AuthorDate: Thu Apr 10 06:59:44 2025 +0200

    Allow literal backslash escapes for string literals in Redshift dialect. 
(#1801)
    
    Co-authored-by: Roman Borschel <[email protected]>
---
 src/dialect/redshift.rs     | 4 ++++
 tests/sqlparser_redshift.rs | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/src/dialect/redshift.rs b/src/dialect/redshift.rs
index d90eb6e7..feccca5d 100644
--- a/src/dialect/redshift.rs
+++ b/src/dialect/redshift.rs
@@ -125,4 +125,8 @@ impl Dialect for RedshiftSqlDialect {
     fn allow_extract_single_quotes(&self) -> bool {
         true
     }
+
+    fn supports_string_literal_backslash_escape(&self) -> bool {
+        true
+    }
 }
diff --git a/tests/sqlparser_redshift.rs b/tests/sqlparser_redshift.rs
index 060e3853..be2b6722 100644
--- a/tests/sqlparser_redshift.rs
+++ b/tests/sqlparser_redshift.rs
@@ -397,3 +397,8 @@ fn parse_extract_single_quotes() {
     let sql = "SELECT EXTRACT('month' FROM my_timestamp) FROM my_table";
     redshift().verified_stmt(sql);
 }
+
+#[test]
+fn parse_string_literal_backslash_escape() {
+    redshift().one_statement_parses_to(r#"SELECT 'l\'auto'"#, "SELECT 
'l''auto'");
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to