mirror of
https://github.com/postgres/postgres.git
synced 2025-12-10 14:22:35 +03:00
Replace TupleTableSlot convention for whole-row variables and function
results with tuples as ordinary varlena Datums. This commit does not in itself do much for us, except eliminate the horrid memory leak associated with evaluation of whole-row variables. However, it lays the groundwork for allowing composite types as table columns, and perhaps some other useful features as well. Per my proposal of a few days ago.
This commit is contained in:
@@ -212,10 +212,12 @@ SELECT name(equipment(p.hobbies)), name(p.hobbies), p.name FROM person* p;
|
||||
SELECT user_relns() AS user_relns
|
||||
ORDER BY user_relns;
|
||||
|
||||
--SELECT name(equipment(hobby_construct(text 'skywalking', text 'mer'))) AS equip_name;
|
||||
SELECT name(equipment(hobby_construct(text 'skywalking', text 'mer')));
|
||||
|
||||
SELECT hobbies_by_name('basketball');
|
||||
|
||||
SELECT name, overpaid(emp.*) FROM emp;
|
||||
|
||||
--
|
||||
-- check that old-style C functions work properly with TOASTed values
|
||||
--
|
||||
|
||||
@@ -663,13 +663,29 @@ SELECT user_relns() AS user_relns
|
||||
xacttest
|
||||
(97 rows)
|
||||
|
||||
--SELECT name(equipment(hobby_construct(text 'skywalking', text 'mer'))) AS equip_name;
|
||||
SELECT name(equipment(hobby_construct(text 'skywalking', text 'mer')));
|
||||
name
|
||||
------
|
||||
guts
|
||||
(1 row)
|
||||
|
||||
SELECT hobbies_by_name('basketball');
|
||||
hobbies_by_name
|
||||
-----------------
|
||||
joe
|
||||
(1 row)
|
||||
|
||||
SELECT name, overpaid(emp.*) FROM emp;
|
||||
name | overpaid
|
||||
--------+----------
|
||||
sharon | t
|
||||
sam | t
|
||||
bill | t
|
||||
jeff | f
|
||||
cim | f
|
||||
linda | f
|
||||
(6 rows)
|
||||
|
||||
--
|
||||
-- check that old-style C functions work properly with TOASTed values
|
||||
--
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $PostgreSQL: pgsql/src/test/regress/regress.c,v 1.59 2003/11/29 19:52:14 pgsql Exp $
|
||||
* $PostgreSQL: pgsql/src/test/regress/regress.c,v 1.60 2004/04/01 21:28:47 tgl Exp $
|
||||
*/
|
||||
|
||||
#include "postgres.h"
|
||||
@@ -15,8 +15,6 @@
|
||||
#define RDELIM ')'
|
||||
#define DELIM ','
|
||||
|
||||
typedef TupleTableSlot *TUPLE;
|
||||
|
||||
extern Datum regress_dist_ptpath(PG_FUNCTION_ARGS);
|
||||
extern Datum regress_path_dist(PG_FUNCTION_ARGS);
|
||||
extern PATH *poly2path(POLYGON *poly);
|
||||
@@ -196,7 +194,7 @@ PG_FUNCTION_INFO_V1(overpaid);
|
||||
Datum
|
||||
overpaid(PG_FUNCTION_ARGS)
|
||||
{
|
||||
TUPLE tuple = (TUPLE) PG_GETARG_POINTER(0);
|
||||
HeapTupleHeader tuple = PG_GETARG_HEAPTUPLEHEADER(0);
|
||||
bool isnull;
|
||||
int32 salary;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user