Correct order of arguments in LIMIT x,y , restrict to MySql and generic dialects (#642)

* 613 Fixing MySQL LIMIT syntax

* 613 Reducing logic to real case scenario

* 613 Adding syntax to generic dialect
This commit is contained in:
AugustoFKL 2022-10-01 18:23:06 -03:00 committed by GitHub
parent fb5a9747ae
commit 3beecc0a7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 16 deletions

View file

@ -1065,6 +1065,14 @@ fn parse_set_names() {
assert_eq!(stmt, Statement::SetNamesDefault {});
}
#[test]
fn parse_limit_my_sql_syntax() {
mysql_and_generic().one_statement_parses_to(
"SELECT id, fname, lname FROM customer LIMIT 5, 10",
"SELECT id, fname, lname FROM customer LIMIT 10 OFFSET 5",
);
}
fn mysql() -> TestedDialects {
TestedDialects {
dialects: vec![Box::new(MySqlDialect {})],