0003-gen_guc_tables-report-duplicate-entry-names-distinct.patch
application/octet-stream
Filename: 0003-gen_guc_tables-report-duplicate-entry-names-distinct.patch
Type: application/octet-stream
Part: 2
Message:
gen_guc_tables improvements
Patch
Format: format-patch
Series: patch 0003
Subject: gen_guc_tables: report duplicate entry names distinctly
| File | + | − |
|---|---|---|
| src/backend/utils/misc/gen_guc_tables.pl | 9 | 2 |
From 163c196f4043b97a27ff79b7d77cc9954f35a63c Mon Sep 17 00:00:00 2001
From: Zsolt Parragi <zsolt.parragi@percona.com>
Date: Sun, 15 Mar 2026 11:22:15 +0000
Subject: [PATCH 3/4] gen_guc_tables: report duplicate entry names distinctly
The existing alphabetical-order check catches duplicates, but reports
them as "not in alphabetical order" which is confusing. Split the
check to give a clear "duplicate entry" message, and also include the
file name and line number in the ordering error.
---
src/backend/utils/misc/gen_guc_tables.pl | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/backend/utils/misc/gen_guc_tables.pl b/src/backend/utils/misc/gen_guc_tables.pl
index b1c1b7afc6c..9b6e3ed6622 100644
--- a/src/backend/utils/misc/gen_guc_tables.pl
+++ b/src/backend/utils/misc/gen_guc_tables.pl
@@ -133,10 +133,17 @@ sub print_table
{
validate_guc_entry($entry);
- if (defined($prev_name) && lc($prev_name) ge lc($entry->{name}))
+ if (defined($prev_name) && lc($prev_name) eq lc($entry->{name}))
{
die sprintf(
- "entries are not in alphabetical order: \"%s\", \"%s\"\n",
+ qq{%s:%d: error: duplicate entry "%s"\n},
+ $input_fname, $entry->{line_number}, $entry->{name});
+ }
+ if (defined($prev_name) && lc($prev_name) gt lc($entry->{name}))
+ {
+ die sprintf(
+ qq{%s:%d: error: entries are not in alphabetical order: "%s", "%s"\n},
+ $input_fname, $entry->{line_number},
$prev_name, $entry->{name});
}
--
2.43.0