mirror of https://github.com/citusdata/citus.git
not append ; if end of the list in StringJoin (#3672)
parent
67d2ad4e37
commit
8dfc2cb122
|
@ -165,10 +165,15 @@ StringJoin(List *stringList, char delimiter)
|
||||||
StringInfo joinedString = makeStringInfo();
|
StringInfo joinedString = makeStringInfo();
|
||||||
|
|
||||||
const char *command = NULL;
|
const char *command = NULL;
|
||||||
|
int curIndex = 0;
|
||||||
foreach_ptr(command, stringList)
|
foreach_ptr(command, stringList)
|
||||||
{
|
{
|
||||||
|
if (curIndex > 0)
|
||||||
|
{
|
||||||
|
appendStringInfoChar(joinedString, delimiter);
|
||||||
|
}
|
||||||
appendStringInfoString(joinedString, command);
|
appendStringInfoString(joinedString, command);
|
||||||
appendStringInfoChar(joinedString, delimiter);
|
curIndex++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return joinedString->data;
|
return joinedString->data;
|
||||||
|
|
Loading…
Reference in New Issue