update src/common/backend/regex/regexec.cpp.

return not matched if start point falls beyond the string
This commit is contained in:
邓旭玥
2022-08-04 12:30:22 +00:00
committed by Gitee
parent ea53267931
commit 955c8b4383

View File

@ -181,7 +181,8 @@ int pg_regexec(regex_t* re, const chr* string, size_t len, size_t search_start,
return REG_INVARG;
if (re->re_csize != sizeof(chr))
return REG_MIXED;
if (search_start > len)
return REG_NOMATCH;
/* Initialize locale-dependent support */
pg_set_regex_collation(re->re_collation);