mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-24 16:04:04 +00:00
Require space after -- to start single line comment in MySQL (#1705)
This commit is contained in:
parent
751dc5afce
commit
443f492b4b
4 changed files with 127 additions and 6 deletions
|
@ -3250,3 +3250,18 @@ fn parse_double_precision() {
|
|||
"CREATE TABLE foo (bar DOUBLE(11,0))",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_looks_like_single_line_comment() {
|
||||
mysql().one_statement_parses_to(
|
||||
"UPDATE account SET balance=balance--1 WHERE account_id=5752",
|
||||
"UPDATE account SET balance = balance - -1 WHERE account_id = 5752",
|
||||
);
|
||||
mysql().one_statement_parses_to(
|
||||
r#"
|
||||
UPDATE account SET balance=balance-- 1
|
||||
WHERE account_id=5752
|
||||
"#,
|
||||
"UPDATE account SET balance = balance WHERE account_id = 5752",
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue