Skip to content

Commit

Permalink
Fix: format elog print
Browse files Browse the repository at this point in the history
  • Loading branch information
yjhjstz committed Nov 8, 2023
1 parent 5b8d9a2 commit e393fbc
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/backend/commands/matview.c
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,7 @@ ivm_immediate_before(PG_FUNCTION_ARGS)

entry->before_trig_count++;

elogif(Debug_print_ivm, INFO, "trigger ivm_immediate_before ref%d, mvid:%d", entry->before_trig_count, matviewOid);
elogif(Debug_print_ivm, INFO, "IVM ivm_immediate_before ref %d, mvid:%d", entry->before_trig_count, matviewOid);

if (Gp_role == GP_ROLE_DISPATCH && !TRIGGER_FIRED_BY_TRUNCATE(trigdata->tg_event))
{
Expand Down Expand Up @@ -1583,7 +1583,7 @@ ivm_immediate_maintenance(PG_FUNCTION_ARGS)
Assert (found && entry != NULL);
entry->after_trig_count++;

elogif(Debug_print_ivm, INFO, "trigger ivm_immediate_maintenance ref%d, mvid:%d", entry->after_trig_count, matviewOid);
elogif(Debug_print_ivm, INFO, "IVM ivm_immediate_maintenance ref %d, mvid:%d", entry->after_trig_count, matviewOid);

oldowner = CurrentResourceOwner;
CurrentResourceOwner = entry->resowner;
Expand Down Expand Up @@ -2116,7 +2116,7 @@ ivm_visible_in_prestate(PG_FUNCTION_ARGS)

ExecClearTuple(table->slot);

elogif(Debug_print_ivm, INFO, "tableoid: %d, ctid: %s, visible %d.", tableoid, ItemPointerToString(itemPtr), result);
elogif(Debug_print_ivm, INFO, "IVM tableoid: %d, ctid: %s, visible %d.", tableoid, ItemPointerToString(itemPtr), result);
PG_RETURN_BOOL(result);
}

Expand Down Expand Up @@ -2539,7 +2539,7 @@ apply_delta(char *old_enr, char *new_enr, MV_TriggerTable *table, Oid matviewOid
if (rc != SPI_OK_REL_REGISTER)
elog(ERROR, "SPI_register failed");

elogif(Debug_print_ivm, INFO, "apply old relation: %s, command_count: %d", enr->md.name, gp_command_count);
elogif(Debug_print_ivm, INFO, "IVM apply old enr %s, command_count: %d", enr->md.name, gp_command_count);
if (use_count)
/* apply old delta and get rows to be recalculated */
apply_old_delta_with_count(matviewname, enr->md.name,
Expand All @@ -2566,7 +2566,7 @@ apply_delta(char *old_enr, char *new_enr, MV_TriggerTable *table, Oid matviewOid
if (rc != SPI_OK_REL_REGISTER)
elog(ERROR, "SPI_register failed");

elogif(Debug_print_ivm, INFO, "apply new relation: %s, command_count: %d", enr->md.name, gp_command_count);
elogif(Debug_print_ivm, INFO, "IVM apply new enr %s, command_count: %d", enr->md.name, gp_command_count);
/* apply new delta */
if (use_count)
apply_new_delta_with_count(matviewname, enr->md.name,
Expand Down Expand Up @@ -2914,7 +2914,7 @@ apply_old_delta_with_count(const char *matviewname, const char *deltaname_old,
(aggs_set != NULL ? aggs_set->data : ""));
if (SPI_exec(querybuf.data, 0) != SPI_OK_UPDATE)
elog(ERROR, "SPI_exec failed: %s", querybuf.data);
elogif(Debug_print_ivm, INFO, "apply_old_delta_with_count update: %s", querybuf.data);
elogif(Debug_print_ivm, INFO, "IVM apply_old_delta_with_count update: %s", querybuf.data);

resetStringInfo(&querybuf);
appendStringInfo(&querybuf,
Expand All @@ -2926,7 +2926,7 @@ apply_old_delta_with_count(const char *matviewname, const char *deltaname_old,
#endif
if (SPI_exec(querybuf.data, 0) != SPI_OK_DELETE)
elog(ERROR, "SPI_exec failed: %s", querybuf.data);
elogif(Debug_print_ivm, INFO, "apply_old_delta_with_count delete: %s", querybuf.data);
elogif(Debug_print_ivm, INFO, "IVM apply_old_delta_with_count delete: %s", querybuf.data);

/* Clean up temp tables. */
resetStringInfo(&querybuf);
Expand Down Expand Up @@ -2982,7 +2982,7 @@ apply_old_delta(const char *matviewname, const char *deltaname_old,

if (SPI_exec(querybuf.data, 0) != SPI_OK_DELETE)
elog(ERROR, "SPI_exec failed: %s", querybuf.data);
elogif(Debug_print_ivm, INFO, "SPI_exec delete: %s", querybuf.data);
elogif(Debug_print_ivm, INFO, "IVM apply_old_delta delete: %s", querybuf.data);
}

/*
Expand Down Expand Up @@ -3060,7 +3060,7 @@ apply_new_delta_with_count(const char *matviewname, const char* deltaname_new,
match_cond);
if (SPI_exec(querybuf.data, 0) != SPI_OK_UPDATE)
elog(ERROR, "SPI_exec failed: %s", querybuf.data);
elogif(Debug_print_ivm, INFO, "apply_new_delta_with_count update: %s", querybuf.data);
elogif(Debug_print_ivm, INFO, "IVM apply_new_delta_with_count update: %s", querybuf.data);

resetStringInfo(&querybuf);
appendStringInfo(&querybuf,
Expand All @@ -3073,7 +3073,7 @@ apply_new_delta_with_count(const char *matviewname, const char* deltaname_new,
#endif
if (SPI_exec(querybuf.data, 0) != SPI_OK_INSERT)
elog(ERROR, "SPI_exec failed: %s", querybuf.data);
elogif(Debug_print_ivm,INFO, "apply_new_delta_with_count insert: %s", querybuf.data);
elogif(Debug_print_ivm,INFO, "IVM apply_new_delta_with_count insert: %s", querybuf.data);
}

/*
Expand Down Expand Up @@ -3102,7 +3102,7 @@ apply_new_delta(const char *matviewname, const char *deltaname_new,

if (SPI_exec(querybuf.data, 0) != SPI_OK_INSERT)
elog(ERROR, "SPI_exec failed: %s", querybuf.data);
elogif(Debug_print_ivm, INFO, "SPI_exec insert: %s", querybuf.data);
elogif(Debug_print_ivm, INFO, "IVM apply_new_delta: %s", querybuf.data);
}

/*
Expand Down Expand Up @@ -3430,7 +3430,7 @@ refresh_matview_memoryfill(DestReceiver *dest, Query *query,

PopActiveSnapshot();

elogif(Debug_print_ivm, INFO, "processed %s, %lu tuples.", queryString, processed);
elogif(Debug_print_ivm, INFO, "IVM processed %s, %lu tuples.", queryString, processed);

return processed;
}
Expand Down Expand Up @@ -3576,7 +3576,7 @@ apply_cleanup(Oid matview_id)
if (SPI_exec(querybuf.data, 0) != SPI_OK_SELECT)
elog(ERROR, "SPI_exec failed: %s", querybuf.data);

elogif(Debug_print_ivm, INFO, "SPI_exec apply_cleanup: %s", querybuf.data);
elogif(Debug_print_ivm, INFO, "IVM apply_cleanup: %s", querybuf.data);

/* Close SPI context. */
if (SPI_finish() != SPI_OK_FINISH)
Expand Down Expand Up @@ -3609,7 +3609,7 @@ ivm_export_snapshot(Oid matview_id, char *snapname)
if (SPI_exec(querybuf.data, 0) != SPI_OK_SELECT)
elog(ERROR, "SPI_exec failed: %s", querybuf.data);

elogif(Debug_print_ivm, INFO, "SPI_exec ivm_export_snapshot: %s", querybuf.data);
elogif(Debug_print_ivm, INFO, "IVM ivm_export_snapshot: %s", querybuf.data);

/* Close SPI context. */
if (SPI_finish() != SPI_OK_FINISH)
Expand Down

0 comments on commit e393fbc

Please sign in to comment.