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
ddd96e1f
Commit
ddd96e1f
authored
23 years ago
by
Tom Lane
Browse files
Options
Downloads
Patches
Plain Diff
Guard against malloc failure. Also, don't examine segP->lastBackend
until we hold the spinlock.
parent
d8adce89
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/backend/storage/ipc/sinval.c
+13
-4
13 additions, 4 deletions
src/backend/storage/ipc/sinval.c
with
13 additions
and
4 deletions
src/backend/storage/ipc/sinval.c
+
13
−
4
View file @
ddd96e1f
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinval.c,v 1.3
1
2001/0
5/18 21:24:20 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinval.c,v 1.3
2
2001/0
6/01 20:07:16 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -283,15 +283,24 @@ GetSnapshotData(bool serializable)
int
index
;
int
count
=
0
;
if
(
snapshot
==
NULL
)
elog
(
ERROR
,
"Memory exhausted in GetSnapshotData"
);
snapshot
->
xmin
=
GetCurrentTransactionId
();
SpinAcquire
(
SInvalLock
);
/*
* There can be no more than lastBackend active transactions, so this
* is enough space:
*/
snapshot
->
xip
=
(
TransactionId
*
)
malloc
(
segP
->
lastBackend
*
sizeof
(
TransactionId
));
snapshot
->
xmin
=
GetCurrentTransactionId
();
SpinAcquire
(
SInvalLock
);
if
(
snapshot
->
xip
==
NULL
)
{
SpinRelease
(
SInvalLock
);
elog
(
ERROR
,
"Memory exhausted in GetSnapshotData"
);
}
/*
* Unfortunately, we have to call ReadNewTransactionId() after
...
...
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