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
7d6fbe15
Commit
7d6fbe15
authored
Aug 06, 2001
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Evaluate LIMIT/OFFSET expressions with ExecEvalExprSwitchContext, not
ExecEvalExpr, to avoid possible memory leak.
parent
5558e15c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
src/backend/executor/nodeLimit.c
src/backend/executor/nodeLimit.c
+11
-9
No files found.
src/backend/executor/nodeLimit.c
View file @
7d6fbe15
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeLimit.c,v 1.
6 2001/03/23 04:49:53 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeLimit.c,v 1.
7 2001/08/06 18:05:07 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -164,10 +164,11 @@ recompute_limits(Limit *node)
...
@@ -164,10 +164,11 @@ recompute_limits(Limit *node)
if
(
node
->
limitOffset
)
if
(
node
->
limitOffset
)
{
{
limitstate
->
offset
=
DatumGetInt32
(
ExecEvalExpr
(
node
->
limitOffset
,
limitstate
->
offset
=
econtext
,
DatumGetInt32
(
ExecEvalExprSwitchContext
(
node
->
limitOffset
,
&
isNull
,
econtext
,
NULL
));
&
isNull
,
NULL
));
/* Interpret NULL offset as no offset */
/* Interpret NULL offset as no offset */
if
(
isNull
)
if
(
isNull
)
limitstate
->
offset
=
0
;
limitstate
->
offset
=
0
;
...
@@ -182,10 +183,11 @@ recompute_limits(Limit *node)
...
@@ -182,10 +183,11 @@ recompute_limits(Limit *node)
if
(
node
->
limitCount
)
if
(
node
->
limitCount
)
{
{
limitstate
->
count
=
DatumGetInt32
(
ExecEvalExpr
(
node
->
limitCount
,
limitstate
->
count
=
econtext
,
DatumGetInt32
(
ExecEvalExprSwitchContext
(
node
->
limitCount
,
&
isNull
,
econtext
,
NULL
));
&
isNull
,
NULL
));
/* Interpret NULL count as no count (LIMIT ALL) */
/* Interpret NULL count as no count (LIMIT ALL) */
if
(
isNull
)
if
(
isNull
)
limitstate
->
noCount
=
true
;
limitstate
->
noCount
=
true
;
...
...
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