mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-09-22 13:42:31 +00:00
Add support for == operator for Sqlite (#970)
This commit is contained in:
parent
f6e4be4c15
commit
71c35d4dfd
2 changed files with 9 additions and 0 deletions
|
@ -885,6 +885,7 @@ impl<'a> Tokenizer<'a> {
|
||||||
chars.next(); // consume
|
chars.next(); // consume
|
||||||
match chars.peek() {
|
match chars.peek() {
|
||||||
Some('>') => self.consume_and_return(chars, Token::RArrow),
|
Some('>') => self.consume_and_return(chars, Token::RArrow),
|
||||||
|
Some('=') => self.consume_and_return(chars, Token::DoubleEq),
|
||||||
_ => Ok(Some(Token::Eq)),
|
_ => Ok(Some(Token::Eq)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,6 +61,14 @@ fn parse_create_virtual_table() {
|
||||||
sqlite_and_generic().verified_stmt(sql);
|
sqlite_and_generic().verified_stmt(sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn double_equality_operator() {
|
||||||
|
// Sqlite supports this operator: https://www.sqlite.org/lang_expr.html#binaryops
|
||||||
|
let input = "SELECT a==b FROM t";
|
||||||
|
let expected = "SELECT a = b FROM t";
|
||||||
|
let _ = sqlite_and_generic().one_statement_parses_to(input, expected);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn parse_create_table_auto_increment() {
|
fn parse_create_table_auto_increment() {
|
||||||
let sql = "CREATE TABLE foo (bar INT PRIMARY KEY AUTOINCREMENT)";
|
let sql = "CREATE TABLE foo (bar INT PRIMARY KEY AUTOINCREMENT)";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue