Avoid character classification in regex escape parsing.
authorJeff Davis <[email protected]>
Fri, 21 Apr 2023 15:19:41 +0000 (08:19 -0700)
committerJeff Davis <[email protected]>
Fri, 21 Apr 2023 15:20:32 +0000 (08:20 -0700)
commitdde926b0f67d461f578e29c5505f21e0c710fba0
treea2ded0ce4f796800ef87b6a8c72cf254507fb9db
parent6d60b718ceb09603eb26b6d6788b5c19c04ec5eb
Avoid character classification in regex escape parsing.

For regex escape sequences, just test directly for the relevant ASCII
characters rather than using locale-sensitive character
classification.

This fixes an assertion failure when a locale considers a non-ASCII
character, such as "൧", to be a digit.

Reported-by: Richard Guo
Discussion: https://postgr.es/m/CAMbWs49Q6UoKGeT8pBkMtJGJd+16CBFZaaWUk9Du+2ERE5g_YA@mail.gmail.com
Backpatch-through: 11
src/backend/regex/regc_lex.c