Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
549928d9
Commit
549928d9
authored
Aug 30, 2002
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for breakage of C-coded SRFs, from Joe Conway.
parent
e2d156fa
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
5 deletions
+31
-5
src/backend/utils/fmgr/funcapi.c
src/backend/utils/fmgr/funcapi.c
+11
-3
src/include/funcapi.h
src/include/funcapi.h
+6
-2
src/test/regress/expected/rangefuncs.out
src/test/regress/expected/rangefuncs.out
+12
-0
src/test/regress/sql/rangefuncs.sql
src/test/regress/sql/rangefuncs.sql
+2
-0
No files found.
src/backend/utils/fmgr/funcapi.c
View file @
549928d9
...
...
@@ -7,7 +7,7 @@
* Copyright (c) 2002, PostgreSQL Global Development Group
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/funcapi.c,v 1.
4 2002/08/29 17:14:33
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/fmgr/funcapi.c,v 1.
5 2002/08/30 19:56:49
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -83,8 +83,16 @@ per_MultiFuncCall(PG_FUNCTION_ARGS)
{
FuncCallContext
*
retval
=
(
FuncCallContext
*
)
fcinfo
->
flinfo
->
fn_extra
;
/* make sure we start with a fresh slot */
if
(
retval
->
slot
!=
NULL
)
/*
* Clear the TupleTableSlot, if present. This is for safety's sake:
* the Slot will be in a long-lived context (it better be, if the
* FuncCallContext is pointing to it), but in most usage patterns the
* tuples stored in it will be in the function's per-tuple context.
* So at the beginning of each call, the Slot will hold a dangling
* pointer to an already-recycled tuple. We clear it out here. (See
* also the definition of TupleGetDatum() in funcapi.h!)
*/
if
(
retval
->
slot
!=
NULL
)
ExecClearTuple
(
retval
->
slot
);
return
retval
;
...
...
src/include/funcapi.h
View file @
549928d9
...
...
@@ -9,7 +9,7 @@
*
* Copyright (c) 2002, PostgreSQL Global Development Group
*
* $Id: funcapi.h,v 1.
6 2002/08/29 17:14:33
tgl Exp $
* $Id: funcapi.h,v 1.
7 2002/08/30 19:56:49
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -147,8 +147,12 @@ extern TupleTableSlot *TupleDescGetSlot(TupleDesc tupdesc);
extern
AttInMetadata
*
TupleDescGetAttInMetadata
(
TupleDesc
tupdesc
);
extern
HeapTuple
BuildTupleFromCStrings
(
AttInMetadata
*
attinmeta
,
char
**
values
);
/*
* Note we pass shouldFree = false; this is needed because the tuple will
* typically be in a shorter-lived memory context than the TupleTableSlot.
*/
#define TupleGetDatum(_slot, _tuple) \
PointerGetDatum(ExecStoreTuple(_tuple, _slot, InvalidBuffer,
tru
e))
PointerGetDatum(ExecStoreTuple(_tuple, _slot, InvalidBuffer,
fals
e))
/*----------
...
...
src/test/regress/expected/rangefuncs.out
View file @
549928d9
SELECT * FROM pg_settings WHERE name LIKE 'enable%';
name | setting
------------------+---------
enable_hashjoin | on
enable_indexscan | on
enable_mergejoin | on
enable_nestloop | on
enable_seqscan | on
enable_sort | on
enable_tidscan | on
(7 rows)
CREATE TABLE foo2(fooid int, f2 int);
INSERT INTO foo2 VALUES(1, 11);
INSERT INTO foo2 VALUES(2, 22);
...
...
src/test/regress/sql/rangefuncs.sql
View file @
549928d9
SELECT
*
FROM
pg_settings
WHERE
name
LIKE
'enable%'
;
CREATE
TABLE
foo2
(
fooid
int
,
f2
int
);
INSERT
INTO
foo2
VALUES
(
1
,
11
);
INSERT
INTO
foo2
VALUES
(
2
,
22
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment