mirror of
https://github.com/postgres/postgres.git
synced 2025-10-16 17:07:43 +03:00
Consistently handle tab delimiters for wait event names
Format validation and element extraction for intermediate line strings were inconsistent in their handling of tab delimiters, which resulted in an unclear error when multiple tab characters were used as a delimiter. This fixes it by using captures from the validation regex instead of a separate split() to avoid the inconsistency. Also, it ensures that \t+ is used consistently when inspecting the strings. Author: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Reviewed-by: Daniel Gustafsson <daniel@yesql.se> Discussion: https://postgr.es/m/20250729.135638.1148639539103758555.horikyota.ntt@gmail.com
This commit is contained in:
@@ -85,7 +85,7 @@ while (<$wait_event_names>)
|
||||
# Sort the lines based on the second column.
|
||||
# uc() is being used to force the comparison to be case-insensitive.
|
||||
my @lines_sorted =
|
||||
sort { uc((split(/\t/, $a))[1]) cmp uc((split(/\t/, $b))[1]) } @lines;
|
||||
sort { uc((split(/\t+/, $a))[1]) cmp uc((split(/\t+/, $b))[1]) } @lines;
|
||||
|
||||
# If we are generating code, concat @lines_sorted and then
|
||||
# @abi_compatibility_lines.
|
||||
@@ -101,7 +101,7 @@ foreach my $line (@lines_sorted)
|
||||
unless $line =~ /^(\w+)\t+(\w+)\t+("\w.*\.")$/;
|
||||
|
||||
(my $waitclassname, my $waiteventname, my $waitevendocsentence) =
|
||||
split(/\t/, $line);
|
||||
($1, $2, $3);
|
||||
|
||||
# Generate the element name for the enums based on the
|
||||
# description. The C symbols are prefixed with "WAIT_EVENT_".
|
||||
|
Reference in New Issue
Block a user