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 {
8080
8181 // See https://cloud.google.com/bigquery/docs/reference/standard-sql/lexical#escape_sequences
8282 fn supports_string_literal_backslash_escape ( & self ) -> bool {
83- true
83+ false
8484 }
8585
8686 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> {
13241324 comment,
13251325 } ) ) )
13261326 }
1327- Some ( '\\' ) if dialect_of ! ( self is SnowflakeDialect ) => {
1328- Ok ( Some ( Token :: Backslash ) )
1329- }
13301327 Some ( '/' ) if dialect_of ! ( self is DuckDbDialect | GenericDialect ) => {
13311328 self . consume_and_return ( chars, Token :: DuckIntDiv )
13321329 }
@@ -2007,6 +2004,21 @@ impl<'a> Tokenizer<'a> {
20072004 return Ok ( s) ;
20082005 }
20092006 }
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+ }
20102022 '\\' if settings. backslash_escape => {
20112023 // consume backslash
20122024 chars. next ( ) ;
You can’t perform that action at this time.
0 commit comments