mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
replace use of predefined perl vars $a and $b with $x and $y - per Greg Sabino Mullane
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$PostgreSQL: pgsql/doc/src/sgml/plperl.sgml,v 2.46 2005/10/12 14:28:33 momjian Exp $
|
$PostgreSQL: pgsql/doc/src/sgml/plperl.sgml,v 2.47 2005/10/18 22:53:54 adunstan Exp $
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<chapter id="plperl">
|
<chapter id="plperl">
|
||||||
@ -118,14 +118,14 @@ $$ LANGUAGE plperl;
|
|||||||
|
|
||||||
<programlisting>
|
<programlisting>
|
||||||
CREATE FUNCTION perl_max (integer, integer) RETURNS integer AS $$
|
CREATE FUNCTION perl_max (integer, integer) RETURNS integer AS $$
|
||||||
my ($a,$b) = @_;
|
my ($x,$y) = @_;
|
||||||
if (! defined $a) {
|
if (! defined $x) {
|
||||||
if (! defined $b) { return undef; }
|
if (! defined $y) { return undef; }
|
||||||
return $b;
|
return $y;
|
||||||
}
|
}
|
||||||
if (! defined $b) { return $a; }
|
if (! defined $y) { return $x; }
|
||||||
if ($a > $b) { return $a; }
|
if ($x > $y) { return $x; }
|
||||||
return $b;
|
return $y;
|
||||||
$$ LANGUAGE plperl;
|
$$ LANGUAGE plperl;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
As shown above, to return an SQL null value from a PL/Perl
|
As shown above, to return an SQL null value from a PL/Perl
|
||||||
|
Reference in New Issue
Block a user