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

@ -413,6 +413,18 @@ fn parse_single_quoted_identified() {
sqlite().verified_only_select("SELECT 't'.*, t.'x' FROM 't'");
// TODO: add support for select 't'.x
}
#[test]
fn parse_substring() {
// SQLite supports the SUBSTRING function since v3.34, but does not support the SQL standard
// SUBSTRING(expr FROM start FOR length) syntax.
// https://www.sqlite.org/lang_corefunc.html#substr
sqlite().verified_only_select("SELECT SUBSTRING('SQLITE', 3, 4)");
sqlite().verified_only_select("SELECT SUBSTR('SQLITE', 3, 4)");
sqlite().verified_only_select("SELECT SUBSTRING('SQLITE', 3)");
sqlite().verified_only_select("SELECT SUBSTR('SQLITE', 3)");
}
#[test]
fn parse_window_function_with_filter() {
for func_name in [