From: Pavan Deolasee Date: Fri, 1 Apr 2016 06:25:43 +0000 (+0530) Subject: extendVar should only reset val_used only when newSize is greater than the X-Git-Tag: XL_10_R1BETA1~698 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=1124f5e21ad87cc166cf474ef01622830f3b978c;p=postgres-xl.git extendVar should only reset val_used only when newSize is greater than the current value of val_used --- 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; }