Skip to content

Commit 30ca39b

Browse files
authored
fix: Propagate NULLs in regexp_count, regexp_instr (apache#24239)
## Which issue does this PR close? - Closes apache#24152 ## Rationale for this change `regexp_count` and `regexp_instr` should follow the behavior of these functions in PostgreSQL and return NULL when any of their arguments is NULL. The previous behavior was inconsistent: `regexp_instr` returned NULL for a NULL string or pattern, but otherwise NULLs were treated as a default value, returned a match count of 0, or raised an error, depending on the context. ## What changes are included in this PR? * Make NULL handling of `regexp_count` and `regexp_instr` consistent and match PostgreSQL * Update SLTs or add new SLTs / unit tests as necessary ## Are these changes tested? Yes, new tests added and/or existing tests updated when necessary. ## Are there any user-facing changes? Yes: the behavior of these UDFs has changed when called with NULL arguments.
1 parent fc4e43e commit 30ca39b

4 files changed

Lines changed: 457 additions & 170 deletions

File tree

0 commit comments

Comments
 (0)