From 19dc7a3ac77f35af2a6dad3596e7adaa41643326 Mon Sep 17 00:00:00 2001 From: Mees Delzenne Date: Thu, 19 Sep 2024 11:36:18 +0200 Subject: [PATCH] Fix immediate insert subquery (#4833) --- core/src/syn/parser/prime.rs | 1 + core/src/syn/parser/test/mod.rs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/core/src/syn/parser/prime.rs b/core/src/syn/parser/prime.rs index f3df4b86..3f5f8ca0 100644 --- a/core/src/syn/parser/prime.rs +++ b/core/src/syn/parser/prime.rs @@ -288,6 +288,7 @@ impl Parser<'_> { t!("RETURN") | t!("SELECT") | t!("CREATE") + | t!("INSERT") | t!("UPSERT") | t!("UPDATE") | t!("DELETE") diff --git a/core/src/syn/parser/test/mod.rs b/core/src/syn/parser/test/mod.rs index 8eb24466..8cbc32a3 100644 --- a/core/src/syn/parser/test/mod.rs +++ b/core/src/syn/parser/test/mod.rs @@ -106,3 +106,9 @@ fn escaped_params_backtick() { ) .unwrap(); } + +#[test] +fn parse_immediate_insert_subquery() { + let res = + test_parse!(parse_query, r#"LET $insert = INSERT INTO t (SELECT true FROM 1);"#).unwrap(); +}