mirror of https://github.com/citusdata/citus.git
Fix memory issues around deparsing index commands (#4270)
parent
f3d3381220
commit
ef49b75cd6
|
@ -684,12 +684,13 @@ deparse_shard_index_statement(IndexStmt *origStmt, Oid distrelid, int64 shardid,
|
||||||
StringInfo buffer)
|
StringInfo buffer)
|
||||||
{
|
{
|
||||||
IndexStmt *indexStmt = copyObject(origStmt); /* copy to avoid modifications */
|
IndexStmt *indexStmt = copyObject(origStmt); /* copy to avoid modifications */
|
||||||
char *relationName = indexStmt->relation->relname;
|
|
||||||
char *indexName = indexStmt->idxname;
|
|
||||||
|
|
||||||
/* extend relation and index name using shard identifier */
|
/* extend relation and index name using shard identifier */
|
||||||
AppendShardIdToName(&relationName, shardid);
|
AppendShardIdToName(&(indexStmt->relation->relname), shardid);
|
||||||
AppendShardIdToName(&indexName, shardid);
|
AppendShardIdToName(&(indexStmt->idxname), shardid);
|
||||||
|
|
||||||
|
char *relationName = indexStmt->relation->relname;
|
||||||
|
char *indexName = indexStmt->idxname;
|
||||||
|
|
||||||
/* use extended shard name and transformed stmt for deparsing */
|
/* use extended shard name and transformed stmt for deparsing */
|
||||||
List *deparseContext = deparse_context_for(relationName, distrelid);
|
List *deparseContext = deparse_context_for(relationName, distrelid);
|
||||||
|
@ -749,10 +750,10 @@ deparse_shard_reindex_statement(ReindexStmt *origStmt, Oid distrelid, int64 shar
|
||||||
if (reindexStmt->kind == REINDEX_OBJECT_INDEX ||
|
if (reindexStmt->kind == REINDEX_OBJECT_INDEX ||
|
||||||
reindexStmt->kind == REINDEX_OBJECT_TABLE)
|
reindexStmt->kind == REINDEX_OBJECT_TABLE)
|
||||||
{
|
{
|
||||||
relationName = reindexStmt->relation->relname;
|
|
||||||
|
|
||||||
/* extend relation and index name using shard identifier */
|
/* extend relation and index name using shard identifier */
|
||||||
AppendShardIdToName(&relationName, shardid);
|
AppendShardIdToName(&(reindexStmt->relation->relname), shardid);
|
||||||
|
|
||||||
|
relationName = reindexStmt->relation->relname;
|
||||||
}
|
}
|
||||||
|
|
||||||
appendStringInfoString(buffer, "REINDEX ");
|
appendStringInfoString(buffer, "REINDEX ");
|
||||||
|
|
Loading…
Reference in New Issue