Allow literal backslash escapes for string literals in Redshift dialect. (#1801)

Co-authored-by: Roman Borschel <roman@cluvio.com>
This commit is contained in:
Roman Borschel 2025-04-10 06:59:44 +02:00 committed by GitHub
parent 0d2976d723
commit cfd8951452
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View file

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

View file

@ -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'");
}