74 #define GETCHAR(t) MATCH_LOWER(t)
76 #define GETCHAR(t) (t)
80 MatchText(
const char *t,
int tlen,
const char *p,
int plen,
84 if (plen == 1 && *p ==
'%')
98 while (tlen > 0 && plen > 0)
107 (
errcode(ERRCODE_INVALID_ESCAPE_SEQUENCE),
108 errmsg(
"LIKE pattern must not end with escape character")));
167 (
errcode(ERRCODE_INVALID_ESCAPE_SEQUENCE),
168 errmsg(
"LIKE pattern must not end with escape character")));
178 int matched =
MatchText(t, tlen, p, plen,
230 while (plen > 0 && *p ==
'%')
246 #ifdef do_like_escape
292 (
errcode(ERRCODE_INVALID_ESCAPE_SEQUENCE),
293 errmsg(
"invalid escape string"),
294 errhint(
"Escape string must be empty or one character.")));
315 if (
CHAREQ(p,
e) && !afterescape)
351 #ifdef do_like_escape
352 #undef do_like_escape
int errhint(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define CopyAdvChar(dst, src, srclen)
#define NextByte(p, plen)
#define NextChar(p, plen)
static int MatchText(const char *t, int tlen, const char *p, int plen, pg_locale_t locale, bool locale_is_c)
void check_stack_depth(void)
#define SET_VARSIZE(PTR, len)
#define VARSIZE_ANY_EXHDR(PTR)