Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitece869b

Browse files
committed
Fix oversight in the previous patch that made LIKE throw error for \ at the
end of the pattern: the code path that handles \ just after % should throwerror too. As in the previous patch, not back-patching for fear of breakingapps that worked before.
1 parent9b94e36 commitece869b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎src/backend/utils/adt/like_match.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* Copyright (c) 1996-2010, PostgreSQL Global Development Group
2020
*
2121
* 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 $
2323
*
2424
*-------------------------------------------------------------------------
2525
*/
@@ -158,7 +158,9 @@ MatchText(char *t, int tlen, char *p, int plen)
158158
if (*p=='\\')
159159
{
160160
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")));
162164
firstpat=GETCHAR(p[1]);
163165
}
164166
else

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp