diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2016-03-01 20:01:07 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2016-03-01 20:01:16 -0500 |
commit | 68c521eb92c3515e3306f51a7fd3f32d16c97524 (patch) | |
tree | ebcd0d08617e11c17d679dd3fadefbffd6411ff5 /src/pl/tcl/sql/pltcl_setup.sql | |
parent | 9def031bd2821f35b5f506260d922482648a8bb0 (diff) | |
download | postgresql-68c521eb92c3515e3306f51a7fd3f32d16c97524.tar.gz postgresql-68c521eb92c3515e3306f51a7fd3f32d16c97524.zip |
Improve coverage of pltcl regression tests.
Test composite-type arguments and the argisnull and spi_lastoid Tcl
commmands. This stuff was not covered before, but needs to be exercised
since the upcoming Tcl object-conversion patch changes these code paths
(and broke at least one of them).
Diffstat (limited to 'src/pl/tcl/sql/pltcl_setup.sql')
-rw-r--r-- | src/pl/tcl/sql/pltcl_setup.sql | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/pl/tcl/sql/pltcl_setup.sql b/src/pl/tcl/sql/pltcl_setup.sql index 84629963229..53358ea361f 100644 --- a/src/pl/tcl/sql/pltcl_setup.sql +++ b/src/pl/tcl/sql/pltcl_setup.sql @@ -429,6 +429,24 @@ create trigger dta2_before before insert or update on T_dta2 check_primkey('ref1', 'ref2', 'T_pkey2', 'key1', 'key2'); +create function tcl_composite_arg_ref1(T_dta1) returns int as ' + return $1(ref1) +' language pltcl; + +create function tcl_composite_arg_ref2(T_dta1) returns text as ' + return $1(ref2) +' language pltcl; + +create function tcl_argisnull(text) returns bool as ' + argisnull 1 +' language pltcl; + +create function tcl_lastoid(tabname text) returns int8 as ' + spi_exec "insert into $1 default values" + spi_lastoid +' language pltcl; + + create function tcl_int4add(int4,int4) returns int4 as ' return [expr $1 + $2] ' language pltcl; |