diff options
Diffstat (limited to 'src/backend/utils/Gen_fmgrtab.pl')
-rw-r--r-- | src/backend/utils/Gen_fmgrtab.pl | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/backend/utils/Gen_fmgrtab.pl b/src/backend/utils/Gen_fmgrtab.pl index 2792373feda..764216c56dd 100644 --- a/src/backend/utils/Gen_fmgrtab.pl +++ b/src/backend/utils/Gen_fmgrtab.pl @@ -24,7 +24,7 @@ my $output_path = ''; my $include_path; GetOptions( - 'output:s' => \$output_path, + 'output:s' => \$output_path, 'include-path:s' => \$include_path) || usage(); # Make sure output_path ends in a slash. @@ -34,7 +34,7 @@ if ($output_path ne '' && substr($output_path, -1) ne '/') } # Sanity check arguments. -die "No input files.\n" unless @ARGV; +die "No input files.\n" unless @ARGV; die "--include-path must be specified.\n" unless $include_path; # Read all the input files into internal data structures. @@ -56,7 +56,7 @@ foreach my $datfile (@ARGV) my $catalog = Catalog::ParseHeader($header); my $catname = $catalog->{catname}; - my $schema = $catalog->{columns}; + my $schema = $catalog->{columns}; $catalogs{$catname} = $catalog; $catalog_data{$catname} = Catalog::ParseData($datfile, $schema, 0); @@ -72,14 +72,14 @@ foreach my $row (@{ $catalog_data{pg_proc} }) push @fmgr, { - oid => $bki_values{oid}, - name => $bki_values{proname}, - lang => $bki_values{prolang}, - kind => $bki_values{prokind}, + oid => $bki_values{oid}, + name => $bki_values{proname}, + lang => $bki_values{prolang}, + kind => $bki_values{prokind}, strict => $bki_values{proisstrict}, retset => $bki_values{proretset}, - nargs => $bki_values{pronargs}, - args => $bki_values{proargtypes}, + nargs => $bki_values{pronargs}, + args => $bki_values{proargtypes}, prosrc => $bki_values{prosrc}, }; @@ -88,10 +88,10 @@ foreach my $row (@{ $catalog_data{pg_proc} }) } # Emit headers for both files -my $tmpext = ".tmp$$"; -my $oidsfile = $output_path . 'fmgroids.h'; +my $tmpext = ".tmp$$"; +my $oidsfile = $output_path . 'fmgroids.h'; my $protosfile = $output_path . 'fmgrprotos.h'; -my $tabfile = $output_path . 'fmgrtab.c'; +my $tabfile = $output_path . 'fmgrtab.c'; open my $ofh, '>', $oidsfile . $tmpext or die "Could not open $oidsfile$tmpext: $!"; @@ -213,7 +213,8 @@ $bmap{'t'} = 'true'; $bmap{'f'} = 'false'; my @fmgr_builtin_oid_index; my $last_builtin_oid = 0; -my $fmgr_count = 0; +my $fmgr_count = 0; + foreach my $s (sort { $a->{oid} <=> $b->{oid} } @fmgr) { next if $s->{lang} ne 'internal'; @@ -273,9 +274,9 @@ close($pfh); close($tfh); # Finally, rename the completed files into place. -Catalog::RenameTempFile($oidsfile, $tmpext); +Catalog::RenameTempFile($oidsfile, $tmpext); Catalog::RenameTempFile($protosfile, $tmpext); -Catalog::RenameTempFile($tabfile, $tmpext); +Catalog::RenameTempFile($tabfile, $tmpext); sub usage { |