=== Applying patches on top of PostgreSQL commit ID bdaad789c843f57b1fc66c5ede7abaff8a915c3b === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Wed Aug 12 20:11:30 UTC 2026 On branch cf/5802 nothing to commit, working tree clean === using 'git am' to apply patch ./v12-0001-Add-TwoStageTable.pm-a-Perl-helper-for-two-stage.patch === Applying: Add TwoStageTable.pm, a Perl helper for two-stage lookup tables === using 'git am' to apply patch ./v12-0002-Improve-the-performance-of-Unicode-Normalization.patch === Applying: Improve the performance of Unicode Normalization Forms Using index info to reconstruct a base tree... M src/common/unicode/Makefile M src/common/unicode/meson.build M src/common/unicode_norm.c Falling back to patching base and 3-way merge... Removing src/include/common/unicode_norm_hashfunc.h Auto-merging src/common/unicode_norm.c CONFLICT (content): Merge conflict in src/common/unicode_norm.c Auto-merging src/common/unicode/meson.build Auto-merging src/common/unicode/Makefile CONFLICT (content): Merge conflict in src/common/unicode/Makefile error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch Patch failed at 0001 Improve the performance of Unicode Normalization Forms 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 ./v12-0002-Improve-the-performance-of-Unicode-Normalization.patch === patching file src/common/unicode/Makefile Hunk #1 FAILED at 21. Hunk #2 succeeded at 46 (offset 2 lines). 1 out of 2 hunks FAILED -- saving rejects to file src/common/unicode/Makefile.rej patching file src/common/unicode/generate-unicode_norm_table.pl patching file src/common/unicode/meson.build patching file src/common/unicode_norm.c Hunk #5 FAILED at 200. 1 out of 5 hunks FAILED -- saving rejects to file src/common/unicode_norm.c.rej patching file src/include/common/unicode_norm_hashfunc.h patching file src/include/common/unicode_norm_table.h patching file src/tools/pgindent/exclude_file_patterns Unstaged changes after reset: M src/common/unicode/Makefile M src/common/unicode/generate-unicode_norm_table.pl M src/common/unicode/meson.build M src/common/unicode_norm.c D src/include/common/unicode_norm_hashfunc.h M src/include/common/unicode_norm_table.h M src/tools/pgindent/exclude_file_patterns Removing src/common/unicode/Makefile.rej Removing src/common/unicode_norm.c.rej === using 'git apply' to apply patch ./v12-0002-Improve-the-performance-of-Unicode-Normalization.patch === Applied patch to 'src/common/unicode/Makefile' with conflicts. Applied patch to 'src/common/unicode/generate-unicode_norm_table.pl' cleanly. Applied patch to 'src/common/unicode/meson.build' cleanly. Applied patch to 'src/common/unicode_norm.c' with conflicts. Falling back to direct application... Applied patch to 'src/include/common/unicode_norm_table.h' cleanly. Applied patch to 'src/tools/pgindent/exclude_file_patterns' cleanly. U src/common/unicode/Makefile U src/common/unicode_norm.c diff --cc src/common/unicode/Makefile index 714ccbe00bd,2f032e42b2d..00000000000 --- a/src/common/unicode/Makefile +++ b/src/common/unicode/Makefile @@@ -21,7 -21,7 +21,11 @@@ CPPFLAGS += $(ICU_CFLAGS # By default, do nothing. all: ++<<<<<<< ours +update-unicode: unicode_case_table.h unicode_category_table.h unicode_east_asian_fw_table.h unicode_nonspacing_table.h unicode_norm_hashfunc.h unicode_limits.h unicode_norm_table.h unicode_normprops_table.h unicode_version.h ++======= + update-unicode: unicode_case_table.h unicode_category_table.h unicode_east_asian_fw_table.h unicode_nonspacing_table.h unicode_norm_table.h unicode_normprops_table.h unicode_version.h ++>>>>>>> theirs mv $^ $(top_srcdir)/src/include/common/ $(MAKE) case-check $(MAKE) category-check diff --cc src/common/unicode_norm.c index 6386ae636c5,0c08bcabe0d..00000000000 --- a/src/common/unicode_norm.c +++ b/src/common/unicode_norm.c @@@ -246,64 -200,9 +200,42 @@@ recompose_code(uint32 start, uint32 cod } else { - const pg_unicode_decomposition *entry; - - /* - * Do an inverse lookup of the decomposition tables to see if anything - * matches. The comparison just needs to be a perfect match on the - * sub-table of size two, because the start character has already been - * recomposed partially. This lookup uses a perfect hash function for - * the backend code. - */ - #ifndef FRONTEND - - int h, - inv_lookup_index; - uint64 hashkey; - pg_unicode_recompinfo recompinfo = UnicodeRecompInfo; - - /* - * Compute the hash function. The hash key is formed by concatenating - * bytes of the two codepoints in network order. See also - * src/common/unicode/generate-unicode_norm_table.pl. - */ - hashkey = pg_hton64(((uint64) start << 32) | (uint64) code); - h = recompinfo.hash(&hashkey); - - /* An out-of-range result implies no match */ - if (h < 0 || h >= recompinfo.num_recomps) - return false; + *result = normalization_inverse(start, code); ++<<<<<<< ours + inv_lookup_index = recompinfo.inverse_lookup[h]; + entry = &UnicodeDecompMain[inv_lookup_index]; + + if (start == UnicodeDecomp_codepoints[entry->dec_index] && + code == UnicodeDecomp_codepoints[entry->dec_index + 1]) + { + *result = entry->codepoint; + return true; + } + +#else + + for (size_t i = 0; i < lengthof(UnicodeDecompMain); i++) + { + entry = &UnicodeDecompMain[i]; + + if (DECOMPOSITION_SIZE(entry) != 2) + continue; + + if (DECOMPOSITION_NO_COMPOSE(entry)) + continue; + + if (start == UnicodeDecomp_codepoints[entry->dec_index] && + code == UnicodeDecomp_codepoints[entry->dec_index + 1]) + { + *result = entry->codepoint; + return true; + } + } +#endif /* !FRONTEND */ ++======= + return *result != 0; ++>>>>>>> theirs } return false;