MCPcopy Create free account
hub / github.com/apache/cloudberry / putVariableValue

Function putVariableValue

src/bin/pgbench/pgbench.c:1672–1688  ·  view source on GitHub ↗

Assign a value to a variable, creating it if need be */ Returns false on failure (bad name) */

Source from the content-addressed store, hash-verified

1670/* Assign a value to a variable, creating it if need be */
1671/* Returns false on failure (bad name) */
1672static bool
1673putVariableValue(CState *st, const char *context, char *name,
1674 const PgBenchValue *value)
1675{
1676 Variable *var;
1677
1678 var = lookupCreateVariable(st, context, name);
1679 if (!var)
1680 return false;
1681
1682 if (var->svalue)
1683 free(var->svalue);
1684 var->svalue = NULL;
1685 var->value = *value;
1686
1687 return true;
1688}
1689
1690/* Assign an integer value to a variable, creating it if need be */
1691/* Returns false on failure (bad name) */

Callers 3

putVariableIntFunction · 0.85
executeMetaCommandFunction · 0.85
mainFunction · 0.85

Calls 1

lookupCreateVariableFunction · 0.85

Tested by

no test coverage detected