diff --git a/src/quotamodel.c b/src/quotamodel.c index 4332a6ee..1a274bd0 100644 --- a/src/quotamodel.c +++ b/src/quotamodel.c @@ -935,8 +935,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 */ - bool connected; - SPI_connect_wrapper(&connected); + bool connected = SPI_connect_wrapper(); if ((plan = SPI_prepare(sql.data, 1, (Oid[]){OIDOID})) == NULL) ereport(ERROR, (errmsg("[diskquota] SPI_prepare(\"%s\") failed", sql.data))); @@ -1359,9 +1358,8 @@ dispatch_rejectmap(char *active_oids) "ARRAY[%s]::oid[]) from gp_dist_random('gp_id')", active_oids); - bool connected; - SPI_connect_wrapper(&connected); - int ret = SPI_execute(sql.data, false, 0); + bool connected = SPI_connect_wrapper(); + int ret = SPI_execute(sql.data, false, 0); if (ret != SPI_OK_SELECT) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), errmsg("[diskquota] diskquota.refresh_rejectmap SPI_execute failed: error code %d", ret)));