=== Applying patches on top of PostgreSQL commit ID 47da198934e9a764ad3c60c5e573ab13b4e2d591 === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Sat Dec 6 12:40:26 UTC 2025 On branch cf/6174 nothing to commit, working tree clean === using 'git am' to apply patch ./v11-0001-Change-some-callers-to-use-pg_ascii_toupper.patch === Applying: Change some callers to use pg_ascii_toupper(). Using index info to reconstruct a base tree... M src/backend/access/transam/xlogfuncs.c M src/backend/utils/adt/cash.c Falling back to patching base and 3-way merge... No changes -- Patch already applied. === using 'git am' to apply patch ./v11-0002-Make-regex-max_chr-depend-on-encoding-not-provid.patch === Applying: Make regex "max_chr" depend on encoding, not provider. Using index info to reconstruct a base tree... M src/backend/regex/regc_pg_locale.c M src/backend/utils/adt/pg_locale_libc.c M src/include/utils/pg_locale.h Falling back to patching base and 3-way merge... No changes -- Patch already applied. === using 'git am' to apply patch ./v11-0003-Fix-inconsistency-between-ltree_strncasecmp-and-.patch === Applying: Fix inconsistency between ltree_strncasecmp() and ltree_crc32_sz(). === using 'git am' to apply patch ./v11-0004-Remove-char_tolower-API.patch === Applying: Remove char_tolower() API. === using 'git am' to apply patch ./v11-0005-Add-pg_iswcased.patch === Applying: Add pg_iswcased(). === using 'git am' to apply patch ./v11-0006-Use-multibyte-aware-extraction-of-pattern-prefix.patch === Applying: Use multibyte-aware extraction of pattern prefixes. error: sha1 information is lacking or useless (src/backend/utils/adt/pg_locale.c). error: could not build fake ancestor hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 Use multibyte-aware extraction of pattern prefixes. When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". === using patch(1) to apply patch ./v11-0006-Use-multibyte-aware-extraction-of-pattern-prefix.patch === patching file src/backend/utils/adt/like.c patching file src/backend/utils/adt/like_support.c Hunk #3 FAILED at 1019. 1 out of 4 hunks FAILED -- saving rejects to file src/backend/utils/adt/like_support.c.rej patching file src/backend/utils/adt/pg_locale.c patching file src/backend/utils/adt/pg_locale_builtin.c patching file src/backend/utils/adt/pg_locale_icu.c patching file src/backend/utils/adt/pg_locale_libc.c patching file src/include/utils/pg_locale.h Unstaged changes after reset: M src/backend/utils/adt/like.c M src/backend/utils/adt/like_support.c M src/backend/utils/adt/pg_locale.c M src/backend/utils/adt/pg_locale_builtin.c M src/backend/utils/adt/pg_locale_icu.c M src/backend/utils/adt/pg_locale_libc.c M src/include/utils/pg_locale.h Removing src/backend/utils/adt/like_support.c.rej === using 'git apply' to apply patch ./v11-0006-Use-multibyte-aware-extraction-of-pattern-prefix.patch === Applied patch to 'src/backend/utils/adt/like.c' cleanly. Applied patch to 'src/backend/utils/adt/like_support.c' with conflicts. error: repository lacks the necessary blob to perform 3-way merge. Falling back to direct application... Applied patch to 'src/backend/utils/adt/pg_locale_builtin.c' cleanly. Applied patch to 'src/backend/utils/adt/pg_locale_icu.c' cleanly. Applied patch to 'src/backend/utils/adt/pg_locale_libc.c' cleanly. Applied patch to 'src/include/utils/pg_locale.h' cleanly. U src/backend/utils/adt/like_support.c diff --cc src/backend/utils/adt/like_support.c index dca1d9be035,2db06bd1728..00000000000 --- a/src/backend/utils/adt/like_support.c +++ b/src/backend/utils/adt/like_support.c @@@ -1031,45 -1074,35 +1074,51 @@@ like_fixed_prefix(Const *patt_const, bo else { bytea *bstr = DatumGetByteaPP(patt_const->constvalue); + char *match; + patt = VARDATA_ANY(bstr); pattlen = VARSIZE_ANY_EXHDR(bstr); ++<<<<<<< ours + patt = (char *) palloc(pattlen); + memcpy(patt, VARDATA_ANY(bstr), pattlen); + Assert(bstr == DatumGetPointer(patt_const->constvalue)); + } + + match = palloc(pattlen + 1); + match_pos = 0; + for (pos = 0; pos < pattlen; pos++) + { + /* % and _ are wildcard characters in LIKE */ + if (patt[pos] == '%' || + patt[pos] == '_') + break; ++======= ++>>>>>>> theirs - /* Backslash escapes the next character */ - if (patt[pos] == '\\') + match = palloc(pattlen + 1); + for (pos = 0; pos < pattlen; pos++) { - pos++; - if (pos >= pattlen) + /* % and _ are wildcard characters in LIKE */ + if (patt[pos] == '%' || + patt[pos] == '_') break; - } - /* Stop if case-varying character (it's sort of a wildcard) */ - if (case_insensitive && - pattern_char_isalpha(patt[pos], is_multibyte, locale)) - break; - - match[match_pos++] = patt[pos]; - } + /* Backslash escapes the next character */ + if (patt[pos] == '\\') + { + pos++; + if (pos >= pattlen) + break; + } - match[match_pos] = '\0'; + match[match_pos++] = patt[pos]; + } - if (typeid != BYTEAOID) - *prefix_const = string_to_const(match, typeid); - else *prefix_const = string_to_bytea_const(match, match_pos); + pfree(match); + } + if (rest_selec != NULL) *rest_selec = like_selectivity(&patt[pos], pattlen - pos, case_insensitive);