Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
RekGRpth committed Oct 30, 2024
1 parent e26a435 commit f2e66f2
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/quotamodel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1124,11 +1124,10 @@ delete_from_table_size_map(ArrayBuildState *tableids, ArrayBuildState *segids)
{
Datum tableid = makeArrayResult(tableids, CurrentMemoryContext);
Datum segid = makeArrayResult(segids, CurrentMemoryContext);

int state = SPI_connect_wrapper();
int ret = SPI_execute_with_args(
"delete from diskquota.table_size where (tableid, segid) in (select * from unnest($1, $2))", 2,
(Oid[]){OIDARRAYOID, INT2ARRAYOID}, (Datum[]){tableid, segid}, NULL, false, 0);
int state = SPI_connect_wrapper();
int ret = SPI_execute_with_args(
"delete from diskquota.table_size where (tableid, segid) in (select * from unnest($1, $2))", 2,
(Oid[]){OIDARRAYOID, INT2ARRAYOID}, (Datum[]){tableid, segid}, NULL, false, 0);
if (ret != SPI_OK_DELETE)
ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR),
errmsg("[diskquota] delete_from_table_size_map SPI_execute failed: error code %d", ret)));
Expand All @@ -1143,11 +1142,10 @@ update_table_size_map(ArrayBuildState *tableids, ArrayBuildState *sizes, ArrayBu
Datum tableid = makeArrayResult(tableids, CurrentMemoryContext);
Datum size = makeArrayResult(sizes, CurrentMemoryContext);
Datum segid = makeArrayResult(segids, CurrentMemoryContext);

int state = SPI_connect_wrapper();
int ret = SPI_execute_with_args(
"delete from diskquota.table_size where (tableid, segid) in (select * from unnest($1, $2))", 2,
(Oid[]){OIDARRAYOID, INT2ARRAYOID}, (Datum[]){tableid, segid}, NULL, false, 0);
int state = SPI_connect_wrapper();
int ret = SPI_execute_with_args(
"delete from diskquota.table_size where (tableid, segid) in (select * from unnest($1, $2))", 2,
(Oid[]){OIDARRAYOID, INT2ARRAYOID}, (Datum[]){tableid, segid}, NULL, false, 0);
if (ret != SPI_OK_DELETE)
ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR),
errmsg("[diskquota] delete_from_table_size_map SPI_execute failed: error code %d", ret)));
Expand Down

0 comments on commit f2e66f2

Please sign in to comment.