Definition at line 84 of file like_match.c.
85{
87
88
89 if (plen == 1 && *p == '%')
91
92
94
95
96
97
98
99
100
101
102
103
104 while (
tlen > 0 && plen > 0)
105 {
106
107
108
109
110 if (*p == '%')
111 {
113
114
115
116
117
118
119
120
121
122
123
124
125
126
128
129 while (plen > 0)
130 {
131 if (*p == '%')
133 else if (*p == '_')
134 {
135
140 }
141 else
142 break;
143 }
144
145
146
147
148
149 if (plen <= 0)
151
152
153
154
155
156
157
158
159
160
161
162
163 if (*p == '\\')
164 {
165 if (plen < 2)
168 errmsg(
"LIKE pattern must not end with escape character")));
170 }
171 else
173
175 {
177 {
179
181 return matched;
182 }
183
185 }
186
187
188
189
190
192 }
193 else if (*p == '_')
194 {
195
198 continue;
199 }
201 {
202
203
204
205
206
207
208
209
218
219
220
221
222
223
228 {
230 {
236 errmsg(
"LIKE pattern must not end with escape character")));
237 }
238 else if (*
p1 ==
'_' || *
p1 ==
'%')
239 break;
240
242 }
243
244
245
246
247
248
249
251 {
253
255 for (
const char *
c = p;
c <
p1;
c++)
256 {
260 }
261
264 }
265 else
266 {
269 }
270
271
272
273
274
276 {
278
280
285 else
287 }
288
289
290
291
292
293
294
297 for (;;)
298 {
300
301
303
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
322 {
324
326 {
329 return matched;
330 }
331 }
332
333
334
335
336
338 {
342 }
343 else
345 }
346 }
347
348 else if (*p == '\\')
349 {
350
352
353 if (plen <= 0)
356 errmsg(
"LIKE pattern must not end with escape character")));
359 }
361 {
362
364 }
365
366
367
368
369
370
371
372
373
374
375
376
377
380 }
381
384
385
386
387
388
389 while (plen > 0 && *p == '%')
391 if (plen <= 0)
393
394
395
396
397
399}
int errcode(int sqlerrcode)
#define ereport(elevel,...)
#define NextByte(p, plen)
#define NextChar(p, plen)
void pfree(void *pointer)
#define CHECK_FOR_INTERRUPTS()
int pg_strncoll(const char *arg1, size_t len1, const char *arg2, size_t len2, pg_locale_t locale)
static char buf[DEFAULT_XLOG_SEG_SIZE]
static int cmp(const chr *x, const chr *y, size_t len)
void check_stack_depth(void)
References b, buf, CHECK_FOR_INTERRUPTS, check_stack_depth(), cmp(), pg_locale_struct::deterministic, ereport, errcode(), errmsg, ERROR, fb(), GETCHAR, LIKE_ABORT, LIKE_FALSE, LIKE_TRUE, MatchText, NextByte, NextChar, palloc(), pfree(), and pg_strncoll().