Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RekGRpth committed Oct 29, 2024
1 parent 3f325f8 commit b5b2cab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/quotamodel.c
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,7 @@ refresh_disk_quota_usage(bool is_init)
static void
calculate_table_disk_usage(StringInfo active_oids, bool is_init)
{
SPI_state state;
bool table_size_map_found;
int64 updated_total_size;
TableSizeEntry *tsentry = NULL;
Expand Down Expand Up @@ -921,6 +922,7 @@ calculate_table_disk_usage(StringInfo active_oids, bool is_init)
* calculate the file size for active table and update namespace_size_map
* and role_size_map
*/
SPI_connect_wrapper(&state);

if ((plan = SPI_prepare(sql.data, 1, (Oid[]){OIDOID})) == NULL)
ereport(ERROR, (errmsg("[diskquota] SPI_prepare(\"%s\") failed", sql.data)));
Expand Down Expand Up @@ -1101,6 +1103,7 @@ calculate_table_disk_usage(StringInfo active_oids, bool is_init)

SPI_cursor_close(portal);
SPI_freeplan(plan);
SPI_finish_wrapper(&state);
pfree(tablesize);

if (tableids) delete_from_table_size_map(tableids, segids);
Expand Down

0 comments on commit b5b2cab

Please sign in to comment.