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
867540b4
Commit
867540b4
authored
13 years ago
by
Simon Riggs
Browse files
Options
Downloads
Patches
Plain Diff
Ensure backwards compatibility for GetStableLatestTransactionId()
parent
afe86a9e
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/backend/access/transam/xact.c
+8
-6
8 additions, 6 deletions
src/backend/access/transam/xact.c
with
8 additions
and
6 deletions
src/backend/access/transam/xact.c
+
8
−
6
View file @
867540b4
...
...
@@ -390,11 +390,10 @@ GetCurrentTransactionIdIfAny(void)
return
CurrentTransactionState
->
transactionId
;
}
/*
* GetStableLatestTransactionId
IfAny
* GetStableLatestTransactionId
*
* Get the
latest
XID once and then return same value for rest of transaction.
* Get the XID once and then return same value for rest of transaction.
* Acts as a useful reference point for maintenance tasks.
*/
TransactionId
...
...
@@ -403,13 +402,16 @@ GetStableLatestTransactionId(void)
static
LocalTransactionId
lxid
=
InvalidLocalTransactionId
;
static
TransactionId
stablexid
=
InvalidTransactionId
;
if
(
lxid
!=
MyProc
->
lxid
||
!
TransactionIdIsValid
(
stablexid
))
if
(
lxid
!=
MyProc
->
lxid
)
{
lxid
=
MyProc
->
lxid
;
stablexid
=
GetTopTransactionIdIfAny
();
if
(
!
TransactionIdIsValid
(
stablexid
))
stablexid
=
ReadNewTransactionId
();
}
Assert
(
TransactionIdIsValid
(
stablexid
));
return
stablexid
;
}
...
...
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