*** ./src/backend/utils/adt/like.c.orig Tue Apr 12 17:58:22 2005 --- ./src/backend/utils/adt/like.c Tue Apr 12 18:45:07 2005 *************** *** 52,60 **** --- 52,75 ---- { int l; + /* + * short cut. When first byte of p1 and p2 is different, these + * characters will not match. + */ + if(*p1 != *p2) + return (0); + l = pg_mblen(p1); if (pg_mblen(p2) != l) return (0); + + /* + * Skip first byte of p1 and p2. These are already checked at + * top of this function. + */ + l--; + p1++; + p2++; while (l--) {