|
19 | 19 | * Copyright (c) 1996-2010, PostgreSQL Global Development Group |
20 | 20 | * |
21 | 21 | * IDENTIFICATION |
22 | | - *$PostgreSQL: pgsql/src/backend/utils/adt/like_match.c,v 1.28 2010/05/2817:35:23 tgl Exp $ |
| 22 | + *$PostgreSQL: pgsql/src/backend/utils/adt/like_match.c,v 1.29 2010/05/2818:18:19 tgl Exp $ |
23 | 23 | * |
24 | 24 | *------------------------------------------------------------------------- |
25 | 25 | */ |
@@ -158,7 +158,9 @@ MatchText(char *t, int tlen, char *p, int plen) |
158 | 158 | if (*p=='\\') |
159 | 159 | { |
160 | 160 | if (plen<2) |
161 | | -returnLIKE_FALSE;/* XXX should throw error */ |
| 161 | +ereport(ERROR, |
| 162 | +(errcode(ERRCODE_INVALID_ESCAPE_SEQUENCE), |
| 163 | +errmsg("LIKE pattern must not end with escape character"))); |
162 | 164 | firstpat=GETCHAR(p[1]); |
163 | 165 | } |
164 | 166 | else |
|