Skip to content

Commit

Permalink
free
Browse files Browse the repository at this point in the history
  • Loading branch information
RekGRpth committed Oct 25, 2024
1 parent ce68d6a commit bfe3cfd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ void conf_main(Datum main_arg) {
text_to_cstring_buffer((text *)DatumGetPointer(SPI_getbinval_my(val, tupdesc, "user", false, TEXTOID)), w->shared->user, sizeof(w->shared->user));
elog(DEBUG1, "row = %lu, user = %s, data = %s, schema = %s, table = %s, sleep = %li, reset = %li, run = %i, hash = %i", row, w->shared->user, w->shared->data, w->shared->schema, w->shared->table, w->shared->sleep, w->shared->reset, w->shared->run, w->shared->hash);
dlist_push_tail((dlist_head *)&head, &w->node);
SPI_freetuple(val);
}
} while (SPI_processed);
SPI_cursor_close_my(portal);
Expand Down
6 changes: 5 additions & 1 deletion task.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ static void task_update(const Task *t) {
portal = SPI_cursor_open_my(src.data, plan, values, NULL, false);
do {
SPI_cursor_fetch_my(src.data, portal, true, task_fetch);
for (uint64 row = 0; row < SPI_processed; row++) elog(DEBUG1, "row = %lu, update id = %li", row, DatumGetInt64(SPI_getbinval_my(SPI_tuptable->vals[row], SPI_tuptable->tupdesc, "id", false, INT8OID)));
for (uint64 row = 0; row < SPI_processed; row++) {
HeapTuple val = SPI_tuptable->vals[row];
elog(DEBUG1, "row = %lu, update id = %li", row, DatumGetInt64(SPI_getbinval_my(val, SPI_tuptable->tupdesc, "id", false, INT8OID)));
SPI_freetuple(val);
}
} while (SPI_processed);
SPI_cursor_close_my(portal);
set_ps_display_my("idle");
Expand Down
7 changes: 6 additions & 1 deletion work.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,11 @@ static void work_reset(void) {
portal = SPI_cursor_open_my(src.data, plan, NULL, NULL, false);
do {
SPI_cursor_fetch_my(src.data, portal, true, work_fetch);
for (uint64 row = 0; row < SPI_processed; row++) elog(WARNING, "row = %lu, reset id = %li", row, DatumGetInt64(SPI_getbinval_my(SPI_tuptable->vals[row], SPI_tuptable->tupdesc, "id", false, INT8OID)));
for (uint64 row = 0; row < SPI_processed; row++) {
HeapTuple val = SPI_tuptable->vals[row];
elog(WARNING, "row = %lu, reset id = %li", row, DatumGetInt64(SPI_getbinval_my(val, SPI_tuptable->tupdesc, "id", false, INT8OID)));
SPI_freetuple(val);
}
} while (SPI_processed);
SPI_cursor_close_my(portal);
SPI_finish_my();
Expand Down Expand Up @@ -657,6 +661,7 @@ static void work_sleep(void) {
t->shared->max = DatumGetInt32(SPI_getbinval_my(val, tupdesc, "max", false, INT4OID));
elog(DEBUG1, "row = %lu, id = %li, hash = %i, group = %s, remote = %s, max = %i", row, t->shared->id, t->shared->hash, t->group, t->remote ? t->remote : task_null, t->shared->max);
dlist_push_tail(&head, &t->node);
SPI_freetuple(val);
}
} while (SPI_processed);
SPI_cursor_close_my(portal);
Expand Down

0 comments on commit bfe3cfd

Please sign in to comment.