Skip to content

Commit cfd8951

Browse files
romanbRoman Borschel
and
Roman Borschel
authored
Allow literal backslash escapes for string literals in Redshift dialect. (#1801)
Co-authored-by: Roman Borschel <[email protected]>
1 parent 0d2976d commit cfd8951

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/dialect/redshift.rs

+4
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,8 @@ impl Dialect for RedshiftSqlDialect {
125125
fn allow_extract_single_quotes(&self) -> bool {
126126
true
127127
}
128+
129+
fn supports_string_literal_backslash_escape(&self) -> bool {
130+
true
131+
}
128132
}

tests/sqlparser_redshift.rs

+5
Original file line numberDiff line numberDiff line change
@@ -397,3 +397,8 @@ fn parse_extract_single_quotes() {
397397
let sql = "SELECT EXTRACT('month' FROM my_timestamp) FROM my_table";
398398
redshift().verified_stmt(sql);
399399
}
400+
401+
#[test]
402+
fn parse_string_literal_backslash_escape() {
403+
redshift().one_statement_parses_to(r#"SELECT 'l\'auto'"#, "SELECT 'l''auto'");
404+
}

0 commit comments

Comments
 (0)