From bbc077fc0e8d5d259fda1c8ae7808bf16d254c98 Mon Sep 17 00:00:00 2001 From: Finn Bear Date: Tue, 12 Sep 2023 04:03:52 -0700 Subject: [PATCH] Bugfix - prevent infinite parser recursion in stmts & binary exprs. (#2675) --- lib/src/sql/value/value.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/src/sql/value/value.rs b/lib/src/sql/value/value.rs index 2f0335f0..478b6782 100644 --- a/lib/src/sql/value/value.rs +++ b/lib/src/sql/value/value.rs @@ -2707,6 +2707,7 @@ impl TryNeg for Value { pub fn value(i: &str) -> IResult<&str, Value> { let (i, start) = single(i)?; if let (i, Some(o)) = opt(operator::binary)(i)? { + let _diving = crate::sql::parser::depth::dive(i)?; let (i, r) = cut(value)(i)?; let expr = match r { Value::Expression(r) => r.augment(start, o), @@ -2837,6 +2838,7 @@ pub fn select(i: &str) -> IResult<&str, Value> { /// Used in CREATE, UPDATE, and DELETE clauses pub fn what(i: &str) -> IResult<&str, Value> { + let _diving = crate::sql::parser::depth::dive(i)?; let (i, v) = alt(( into(idiom::multi_without_start), function_or_const,