Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
ffb087ce
Commit
ffb087ce
authored
21 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
This patch refactors execTuples.c in two ways.
Neil Conway
parent
8f61184d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/backend/executor/execTuples.c
+26
-62
26 additions, 62 deletions
src/backend/executor/execTuples.c
with
26 additions
and
62 deletions
src/backend/executor/execTuples.c
+
26
−
62
View file @
ffb087ce
...
...
@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/executor/execTuples.c,v 1.7
3
2003/1
1/29 19:51:48 pgsql
Exp $
* $PostgreSQL: pgsql/src/backend/executor/execTuples.c,v 1.7
4
2003/1
2/01 23:09:02 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -112,6 +112,8 @@
#include
"executor/executor.h"
#include
"utils/lsyscache.h"
static
TupleDesc
ExecTypeFromTLInternal
(
List
*
targetList
,
bool
hasoid
,
bool
skipjunk
);
/* ----------------------------------------------------------------
* tuple table create/delete functions
...
...
@@ -469,13 +471,6 @@ ExecSetSlotDescriptorIsNew(TupleTableSlot *slot, /* slot to change */
* is used for initializing special-purpose slots.
* --------------------------------
*/
#define INIT_SLOT_DEFS \
TupleTable tupleTable; \
TupleTableSlot* slot
#define INIT_SLOT_ALLOC \
tupleTable = (TupleTable) estate->es_tupleTable; \
slot = ExecAllocTableSlot(tupleTable);
/* ----------------
* ExecInitResultTupleSlot
...
...
@@ -484,9 +479,7 @@ ExecSetSlotDescriptorIsNew(TupleTableSlot *slot, /* slot to change */
void
ExecInitResultTupleSlot
(
EState
*
estate
,
PlanState
*
planstate
)
{
INIT_SLOT_DEFS
;
INIT_SLOT_ALLOC
;
planstate
->
ps_ResultTupleSlot
=
slot
;
planstate
->
ps_ResultTupleSlot
=
ExecAllocTableSlot
(
estate
->
es_tupleTable
);
}
/* ----------------
...
...
@@ -496,9 +489,7 @@ ExecInitResultTupleSlot(EState *estate, PlanState *planstate)
void
ExecInitScanTupleSlot
(
EState
*
estate
,
ScanState
*
scanstate
)
{
INIT_SLOT_DEFS
;
INIT_SLOT_ALLOC
;
scanstate
->
ss_ScanTupleSlot
=
slot
;
scanstate
->
ss_ScanTupleSlot
=
ExecAllocTableSlot
(
estate
->
es_tupleTable
);
}
/* ----------------
...
...
@@ -508,9 +499,7 @@ ExecInitScanTupleSlot(EState *estate, ScanState *scanstate)
TupleTableSlot
*
ExecInitExtraTupleSlot
(
EState
*
estate
)
{
INIT_SLOT_DEFS
;
INIT_SLOT_ALLOC
;
return
slot
;
return
ExecAllocTableSlot
(
estate
->
es_tupleTable
);
}
/* ----------------
...
...
@@ -560,34 +549,7 @@ ExecInitNullTupleSlot(EState *estate, TupleDesc tupType)
TupleDesc
ExecTypeFromTL
(
List
*
targetList
,
bool
hasoid
)
{
TupleDesc
typeInfo
;
List
*
tlitem
;
int
len
;
/*
* allocate a new typeInfo
*/
len
=
ExecTargetListLength
(
targetList
);
typeInfo
=
CreateTemplateTupleDesc
(
len
,
hasoid
);
/*
* scan list, generate type info for each entry
*/
foreach
(
tlitem
,
targetList
)
{
TargetEntry
*
tle
=
lfirst
(
tlitem
);
Resdom
*
resdom
=
tle
->
resdom
;
TupleDescInitEntry
(
typeInfo
,
resdom
->
resno
,
resdom
->
resname
,
resdom
->
restype
,
resdom
->
restypmod
,
0
,
false
);
}
return
typeInfo
;
return
ExecTypeFromTLInternal
(
targetList
,
hasoid
,
false
);
}
/* ----------------------------------------------------------------
...
...
@@ -599,30 +561,32 @@ ExecTypeFromTL(List *targetList, bool hasoid)
TupleDesc
ExecCleanTypeFromTL
(
List
*
targetList
,
bool
hasoid
)
{
TupleDesc
typeInfo
;
List
*
tlitem
;
int
len
;
int
cleanresno
;
return
ExecTypeFromTLInternal
(
targetList
,
hasoid
,
true
);
}
/*
* allocate a new typeInfo
*/
len
=
ExecCleanTargetListLength
(
targetList
);
static
TupleDesc
ExecTypeFromTLInternal
(
List
*
targetList
,
bool
hasoid
,
bool
skipjunk
)
{
TupleDesc
typeInfo
;
List
*
l
;
int
len
;
int
cur_resno
=
1
;
if
(
skipjunk
)
len
=
ExecCleanTargetListLength
(
targetList
);
else
len
=
ExecTargetListLength
(
targetList
);
typeInfo
=
CreateTemplateTupleDesc
(
len
,
hasoid
);
/*
* scan list, generate type info for each entry
*/
cleanresno
=
1
;
foreach
(
tlitem
,
targetList
)
foreach
(
l
,
targetList
)
{
TargetEntry
*
tle
=
lfirst
(
tlitem
);
Resdom
*
resdom
=
tle
->
resdom
;
TargetEntry
*
tle
=
lfirst
(
l
);
Resdom
*
resdom
=
tle
->
resdom
;
if
(
resdom
->
resjunk
)
if
(
skipjunk
&&
resdom
->
resjunk
)
continue
;
TupleDescInitEntry
(
typeInfo
,
c
lean
resno
++
,
c
ur_
resno
++
,
resdom
->
resname
,
resdom
->
restype
,
resdom
->
restypmod
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment