File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ impl Dialect for SnowflakeDialect {
80
80
81
81
// See https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#escape_sequences
82
82
fn supports_string_literal_backslash_escape ( & self ) -> bool {
83
- true
83
+ false
84
84
}
85
85
86
86
fn supports_within_after_array_aggregation ( & self ) -> bool {
Original file line number Diff line number Diff line change @@ -1324,9 +1324,6 @@ impl<'a> Tokenizer<'a> {
1324
1324
comment,
1325
1325
} ) ) )
1326
1326
}
1327
- Some ( '\\' ) if dialect_of ! ( self is SnowflakeDialect ) => {
1328
- Ok ( Some ( Token :: Backslash ) )
1329
- }
1330
1327
Some ( '/' ) if dialect_of ! ( self is DuckDbDialect | GenericDialect ) => {
1331
1328
self . consume_and_return ( chars, Token :: DuckIntDiv )
1332
1329
}
@@ -2007,6 +2004,21 @@ impl<'a> Tokenizer<'a> {
2007
2004
return Ok ( s) ;
2008
2005
}
2009
2006
}
2007
+ char if dialect_of ! ( self is SnowflakeDialect ) && char. is_ascii_control ( ) => {
2008
+ let n = match char {
2009
+ '\x00' => '\0' ,
2010
+ '\x07' => '\u{7}' ,
2011
+ '\x08' => '\u{8}' ,
2012
+ '\x12' => '\u{c}' ,
2013
+ '\x10' => '\n' ,
2014
+ '\x13' => '\r' ,
2015
+ '\x09' => '\t' ,
2016
+ '\x26' => '\u{1a}' ,
2017
+ _ => char,
2018
+ } ;
2019
+ s. push ( n) ;
2020
+ chars. next ( ) ; // consume symbol
2021
+ }
2010
2022
'\\' if settings. backslash_escape => {
2011
2023
// consume backslash
2012
2024
chars. next ( ) ;
You can’t perform that action at this time.
0 commit comments