File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1229,8 +1229,11 @@ impl MirScalarExpr {
12291229 . map_or ( "" , |expr| expr. as_literal_str ( ) . unwrap ( ) ) ;
12301230 let ( limit, flags) = regexp_replace_parse_flags ( flags) ;
12311231
1232- // Defer errors until evaluation instead of eagerly returning them here
1233- // to match the error behavior of the dynamic function (part of database-issues#4972).
1232+ // The behavior of `regexp_replace` is that if the data is `NULL`, the
1233+ // function returns `NULL`, independently of whether the pattern or
1234+ // flags are correct. We need to check for this case and introduce an
1235+ // if-then-else on the error path to only surface the error if the first
1236+ // input is non-NULL.
12341237 * e = match func:: build_regex ( pattern, & flags) {
12351238 Ok ( regex) => {
12361239 let mut exprs = mem:: take ( exprs) ;
You can’t perform that action at this time.
0 commit comments