diff options
| -rw-r--r-- | src/gtm/main/gtm_seq.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gtm/main/gtm_seq.c b/src/gtm/main/gtm_seq.c index 359a9598a6..570636be58 100644 --- a/src/gtm/main/gtm_seq.c +++ b/src/gtm/main/gtm_seq.c @@ -695,8 +695,12 @@ GTM_SeqSetVal(GTM_SequenceKey seqkey, GTM_Sequence nextval, bool iscalled) if (seqinfo->gs_value != nextval) seqinfo->gs_value = nextval; - if (seqinfo->gs_called != iscalled) - seqinfo->gs_called = iscalled; + + seqinfo->gs_called = iscalled; + + /* If sequence is not called, reset the init value to the value set */ + if (!iscalled) + seqinfo->gs_init_value = nextval; /* Remove the old key with the old name */ GTM_RWLockRelease(&seqinfo->gs_lock); |
