From 41ebb2ad72c8432bae643daed980c818344b1df8 Mon Sep 17 00:00:00 2001 From: Xu Date: Thu, 14 Sep 2023 22:02:08 -0400 Subject: [PATCH] fix(regexp): substraction overflow when incorrectly speicifying `start` (#12325) --- src/expr/src/vector_op/regexp.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/expr/src/vector_op/regexp.rs b/src/expr/src/vector_op/regexp.rs index fef488b23afb0..9cf713551cff4 100644 --- a/src/expr/src/vector_op/regexp.rs +++ b/src/expr/src/vector_op/regexp.rs @@ -173,7 +173,7 @@ fn regexp_count_start0(text: &str, regex: &RegexpContext) -> Result { fn regexp_count(text: &str, start: i32, regex: &RegexpContext) -> Result { // First get the start position to count for let start = match start { - ..0 => { + ..=0 => { return Err(ExprError::InvalidParam { name: "start", reason: start.to_string().into(), @@ -257,7 +257,7 @@ fn regexp_replace( ) -> Result> { // The start position to begin the search let start = match start { - ..0 => { + ..=0 => { return Err(ExprError::InvalidParam { name: "start", reason: start.to_string().into(),