mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-17 01:07:19 +00:00
Parse byte/bit string literals in MySQL and Postgres (#1532)
This commit is contained in:
parent
73947a5f02
commit
fad2ddd641
3 changed files with 25 additions and 2 deletions
|
@ -704,8 +704,9 @@ impl<'a> Tokenizer<'a> {
|
|||
}
|
||||
Ok(Some(Token::Whitespace(Whitespace::Newline)))
|
||||
}
|
||||
// BigQuery uses b or B for byte string literal
|
||||
b @ 'B' | b @ 'b' if dialect_of!(self is BigQueryDialect | GenericDialect) => {
|
||||
// BigQuery and MySQL use b or B for byte string literal, Postgres for bit strings
|
||||
b @ 'B' | b @ 'b' if dialect_of!(self is BigQueryDialect | PostgreSqlDialect | MySqlDialect | GenericDialect) =>
|
||||
{
|
||||
chars.next(); // consume
|
||||
match chars.peek() {
|
||||
Some('\'') => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue