Add #[recursive] (#1522)

Co-authored-by: Ifeanyi Ubah <ify1992@yahoo.com>
This commit is contained in:
Dmitrii Blaginin 2024-12-19 22:17:20 +03:00 committed by GitHub
parent c973df35d6
commit 84e82e6e2e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 93 additions and 2 deletions

View file

@ -12433,3 +12433,16 @@ fn test_table_sample() {
dialects.verified_stmt("SELECT * FROM tbl AS t TABLESAMPLE SYSTEM (50)");
dialects.verified_stmt("SELECT * FROM tbl AS t TABLESAMPLE SYSTEM (50) REPEATABLE (10)");
}
#[test]
fn overflow() {
let expr = std::iter::repeat("1")
.take(1000)
.collect::<Vec<_>>()
.join(" + ");
let sql = format!("SELECT {}", expr);
let mut statements = Parser::parse_sql(&GenericDialect {}, sql.as_str()).unwrap();
let statement = statements.pop().unwrap();
assert_eq!(statement.to_string(), sql);
}