diff options
author | Pavan Deolasee | 2016-04-01 06:25:43 +0000 |
---|---|---|
committer | Pavan Deolasee | 2016-10-18 10:05:04 +0000 |
commit | 1124f5e21ad87cc166cf474ef01622830f3b978c (patch) | |
tree | c90fff4b8795932284ba3ea7edca1fc02b3813cc | |
parent | a9f99b9bba896c07b6bca8c45e7884bb666c3765 (diff) |
extendVar should only reset val_used only when newSize is greater than the
current value of val_used
-rw-r--r-- | contrib/pgxc_ctl/variables.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/pgxc_ctl/variables.c b/contrib/pgxc_ctl/variables.c index 6d9be10230..b946dfb2f4 100644 --- a/contrib/pgxc_ctl/variables.c +++ b/contrib/pgxc_ctl/variables.c @@ -422,7 +422,8 @@ int extendVar(char *name, int newSize, char *def_value) /* Store NULL in the last element to mark the end-of-array */ (target->val)[newSize] = NULL; - target->val_used = newSize; + if (target->val_used < newSize) + target->val_used = newSize; return 0; } |