Commit 15bb93e2 authored by Tom Lane's avatar Tom Lane

Fix portability problem in Catalog.pm.

Commit 7666e73a introduced a dependency on filehandles' input_line_number
method, but apparently that's a Perl neologism.  Use $. instead, which
works at least back to Perl 5.10, and hopefully back to 5.8.

Jeff Janes

Discussion: https://postgr.es/m/CAMkU=1wuQW=xVfu-14A4VCvxO0ohkD3m9vk6HOj_dprQoKNAQw@mail.gmail.com
parent 395bfaae
...@@ -66,6 +66,9 @@ sub Catalogs ...@@ -66,6 +66,9 @@ sub Catalogs
redo; redo;
} }
# Remember input line number for later.
my $input_line_number = $.;
# Strip useless whitespace and trailing semicolons. # Strip useless whitespace and trailing semicolons.
chomp; chomp;
s/^\s+//; s/^\s+//;
...@@ -80,7 +83,7 @@ sub Catalogs ...@@ -80,7 +83,7 @@ sub Catalogs
elsif (/^DATA\(insert(\s+OID\s+=\s+(\d+))?\s+\(\s*(.*)\s*\)\s*\)$/) elsif (/^DATA\(insert(\s+OID\s+=\s+(\d+))?\s+\(\s*(.*)\s*\)\s*\)$/)
{ {
check_natts($filename, $catalog{natts}, $3, check_natts($filename, $catalog{natts}, $3,
$input_file, INPUT_FILE->input_line_number); $input_file, $input_line_number);
push @{ $catalog{data} }, { oid => $2, bki_values => $3 }; push @{ $catalog{data} }, { oid => $2, bki_values => $3 };
} }
...@@ -242,4 +245,5 @@ sub check_natts ...@@ -242,4 +245,5 @@ sub check_natts
$file, $line, $natts, scalar @atts $file, $line, $natts, scalar @atts
unless $natts == @atts; unless $natts == @atts;
} }
1; 1;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment