diff options
author | Pavan Deolasee | 2017-08-04 07:33:49 +0000 |
---|---|---|
committer | Pavan Deolasee | 2017-08-04 07:33:49 +0000 |
commit | bedf71afd281a380cae25ed2728310ca625dbbd8 (patch) | |
tree | 100f863a5772adf26dc1bd81a256b9a01ca826b2 | |
parent | abee5fd1ac0a3156d82a926000cd0ad792ad2144 (diff) |
Correct a mistake occurred during merging sequence.c code
We were incorrectly overwriting the 'cached' value in the SeqTable element,
thus causing another request to the GTM when nextval is fetched. This resulted
in an unintentional gaps in the sequence values. This patch fixes that, though
we might still get gaps unless sequence_range is set to 1. But this is by
design to reduce repeated round trips to the GTM.
-rw-r--r-- | src/backend/commands/sequence.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c index 67aeb512d2..b9cfe989b0 100644 --- a/src/backend/commands/sequence.c +++ b/src/backend/commands/sequence.c @@ -945,13 +945,6 @@ nextval_internal(Oid relid, bool check_permissions) log -= fetch; /* adjust for any unfetched numbers */ Assert(log >= 0); - /* save info in local cache */ - elm->last = result; /* last returned number */ - elm->cached = last; /* last fetched number */ - elm->last_valid = true; - - last_used_seq = elm; - /* * If something needs to be WAL logged, acquire an xid, so this * transaction's commit will trigger a WAL flush and wait for syncrep. |