Parse SUBSTRING FROM syntax in all dialects, reflect change in the AST (#1173)

This commit is contained in:
Ophir LOJKINE 2024-03-13 16:08:27 +01:00 committed by GitHub
parent 929c646bba
commit 6b03a259aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 47 additions and 95 deletions

View file

@ -1911,7 +1911,7 @@ fn parse_substring_in_select() {
let sql = "SELECT DISTINCT SUBSTRING(description, 0, 1) FROM test";
match mysql().one_statement_parses_to(
sql,
"SELECT DISTINCT SUBSTRING(description FROM 0 FOR 1) FROM test",
"SELECT DISTINCT SUBSTRING(description, 0, 1) FROM test",
) {
Statement::Query(query) => {
assert_eq!(
@ -1927,7 +1927,7 @@ fn parse_substring_in_select() {
})),
substring_from: Some(Box::new(Expr::Value(number("0")))),
substring_for: Some(Box::new(Expr::Value(number("1")))),
special: false,
special: true,
})],
into: None,
from: vec![TableWithJoins {