Skip to content

Commit ad11c54

Browse files
committed
Several minor issues fixed
1 parent 8fcc81f commit ad11c54

File tree

2 files changed

+98
-66
lines changed

2 files changed

+98
-66
lines changed

src/postgresql/cloudsync_postgresql.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,8 @@ Datum cloudsync_update_transfn (PG_FUNCTION_ARGS) {
13411341
}
13421342

13431343
MemoryContext old_ctx = MemoryContextSwitchTo(allocContext);
1344-
MemoryContextStats(allocContext);
1344+
// debug code
1345+
// MemoryContextStats(allocContext);
13451346
pgvalue_t *table_name = pgvalue_create(table_datum, table_type, -1, fcinfo->fncollation, table_null);
13461347
pgvalue_t *new_value = pgvalue_create(new_datum, new_type, -1, fcinfo->fncollation, new_null);
13471348
pgvalue_t *old_value = pgvalue_create(old_datum, old_type, -1, fcinfo->fncollation, old_null);
@@ -2037,10 +2038,12 @@ static char * build_union_sql (void) {
20372038

20382039
pfree(quoted_base);
20392040
pfree(nsp_lit);
2041+
bool nsp_was_quoted = (quoted_nsp != nsp);
20402042
pfree(nsp);
2041-
if (quoted_nsp != nsp) pfree((void *)quoted_nsp);
2043+
if (nsp_was_quoted) pfree((void *)quoted_nsp);
2044+
bool rel_was_quoted = (quoted_rel != rel);
20422045
pfree(rel);
2043-
if (quoted_rel != rel) pfree((void *)quoted_rel);
2046+
if (rel_was_quoted) pfree((void *)quoted_rel);
20442047
}
20452048
if (nsp_list) pfree(nsp_list);
20462049
if (rel_list) pfree(rel_list);

0 commit comments

Comments
 (0)