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
ed698643
Commit
ed698643
authored
Apr 01, 2018
by
Andrew Dunstan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small cleanups in fast default code.
Problems identified by Andres Freund and Haribabu Kommi
parent
94173d3e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
15 deletions
+14
-15
src/backend/access/common/heaptuple.c
src/backend/access/common/heaptuple.c
+8
-5
src/backend/executor/execTuples.c
src/backend/executor/execTuples.c
+6
-10
No files found.
src/backend/access/common/heaptuple.c
View file @
ed698643
...
...
@@ -127,7 +127,6 @@ slot_getmissingattrs(TupleTableSlot *slot, int startAttNum, int lastAttNum)
if
(
slot
->
tts_tupleDescriptor
->
constr
)
attrmiss
=
slot
->
tts_tupleDescriptor
->
constr
->
missing
;
if
(
!
attrmiss
)
{
/* no missing values array at all, so just fill everything in as NULL */
...
...
@@ -139,9 +138,9 @@ slot_getmissingattrs(TupleTableSlot *slot, int startAttNum, int lastAttNum)
else
{
/* if there is a missing values array we must process them one by one */
for
(
missattnum
=
lastAttNum
-
1
;
missattnum
>=
star
tAttNum
;
missattnum
--
)
for
(
missattnum
=
startAttNum
;
missattnum
<
las
tAttNum
;
missattnum
++
)
{
slot
->
tts_values
[
missattnum
]
=
attrmiss
[
missattnum
].
ammissing
;
slot
->
tts_isnull
[
missattnum
]
=
...
...
@@ -1636,6 +1635,8 @@ slot_getallattrs(TupleTableSlot *slot)
slot_deform_tuple
(
slot
,
attnum
);
attnum
=
slot
->
tts_nvalid
;
/*
* If tuple doesn't have all the atts indicated by tupleDesc, read the
* rest as NULLS or missing values.
...
...
@@ -1681,8 +1682,10 @@ slot_getsomeattrs(TupleTableSlot *slot, int attnum)
slot_deform_tuple
(
slot
,
attno
);
attno
=
slot
->
tts_nvalid
;
/*
* If tuple doesn't have all the atts indicated by
tupleDesc
, read the
* If tuple doesn't have all the atts indicated by
attnum
, read the
* rest as NULLs or missing values
*/
if
(
attno
<
attnum
)
...
...
src/backend/executor/execTuples.c
View file @
ed698643
...
...
@@ -626,8 +626,7 @@ ExecCopySlotMinimalTuple(TupleTableSlot *slot)
return
heap_copy_minimal_tuple
(
slot
->
tts_mintuple
);
if
(
slot
->
tts_tuple
)
{
if
(
TTS_HAS_PHYSICAL_TUPLE
(
slot
)
&&
HeapTupleHeaderGetNatts
(
slot
->
tts_tuple
->
t_data
)
if
(
HeapTupleHeaderGetNatts
(
slot
->
tts_tuple
->
t_data
)
<
slot
->
tts_tupleDescriptor
->
natts
)
return
minimal_expand_tuple
(
slot
->
tts_tuple
,
slot
->
tts_tupleDescriptor
);
...
...
@@ -675,18 +674,15 @@ ExecFetchSlotTuple(TupleTableSlot *slot)
if
(
HeapTupleHeaderGetNatts
(
slot
->
tts_tuple
->
t_data
)
<
slot
->
tts_tupleDescriptor
->
natts
)
{
HeapTuple
tuple
;
MemoryContext
oldContext
=
MemoryContextSwitchTo
(
slot
->
tts_mcxt
);
slot
->
tts_tuple
=
heap_expand_tuple
(
slot
->
tts_tuple
,
slot
->
tts_tupleDescriptor
);
slot
->
tts_shouldFree
=
true
;
tuple
=
heap_expand_tuple
(
slot
->
tts_tuple
,
slot
->
tts_tupleDescriptor
);
MemoryContextSwitchTo
(
oldContext
);
return
slot
->
tts_tuple
;
}
else
{
return
slot
->
tts_tuple
;
slot
=
ExecStoreTuple
(
tuple
,
slot
,
InvalidBuffer
,
true
);
}
return
slot
->
tts_tuple
;
}
/*
...
...
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