From 90a6577df31230ddd44a0d4435001210638c297e Mon Sep 17 00:00:00 2001 From: Georgy Shelkovy Date: Tue, 29 Oct 2024 14:00:46 +0500 Subject: [PATCH] rename --- src/diskquota.c | 16 ++++++++-------- src/diskquota.h | 4 ++-- src/diskquota_utility.c | 12 ++++++------ src/gp_activetable.c | 4 ++-- src/quotamodel.c | 16 ++++++++-------- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/diskquota.c b/src/diskquota.c index 1dd5af37..420a2b21 100644 --- a/src/diskquota.c +++ b/src/diskquota.c @@ -986,7 +986,7 @@ create_monitor_db_table(void) */ PG_TRY(); { - SPI_connect_my(&state); + SPI_connect_wrapper(&state); /* debug_query_string need to be set for SPI_execute utility functions. */ debug_query_string = sql; @@ -1011,7 +1011,7 @@ create_monitor_db_table(void) RESUME_INTERRUPTS(); } PG_END_TRY(); - SPI_finish_my(&state); + SPI_finish_wrapper(&state); debug_query_string = NULL; } @@ -1034,7 +1034,7 @@ init_database_list(void) * startup worker for diskquota launcher. If error happens, we just let * launcher exits. */ - SPI_connect_my(&state); + SPI_connect_wrapper(&state); ret = SPI_execute("select dbid from diskquota_namespace.database_list;", true, 0); if (ret != SPI_OK_SELECT) @@ -1104,7 +1104,7 @@ init_database_list(void) update_monitor_db_mpp(dbEntry->dbid, ADD_DB_TO_MONITOR, LAUNCHER_SCHEMA); } } - SPI_finish_my(&state); + SPI_finish_wrapper(&state); /* TODO: clean invalid database */ if (num_db > diskquota_max_workers) DiskquotaLauncherShmem->isDynamicWorker = true; } @@ -1163,7 +1163,7 @@ do_process_extension_ddl_message(MessageResult *code, ExtensionDDLMessage local_ */ PG_TRY(); { - SPI_connect_my(&state); + SPI_connect_wrapper(&state); switch (local_extension_ddl_message.cmd) { @@ -1196,7 +1196,7 @@ do_process_extension_ddl_message(MessageResult *code, ExtensionDDLMessage local_ } PG_END_TRY(); - SPI_finish_my(&state); + SPI_finish_wrapper(&state); /* update something in memory after transaction committed */ if (state.do_commit) @@ -1205,7 +1205,7 @@ do_process_extension_ddl_message(MessageResult *code, ExtensionDDLMessage local_ { /* update_monitor_db_mpp runs sql to distribute dbid to segments */ Oid dbid = local_extension_ddl_message.dbid; - SPI_connect_my(&state); + SPI_connect_wrapper(&state); switch (local_extension_ddl_message.cmd) { case CMD_CREATE_EXTENSION: @@ -1239,7 +1239,7 @@ do_process_extension_ddl_message(MessageResult *code, ExtensionDDLMessage local_ } PG_END_TRY(); - SPI_finish_my(&state); + SPI_finish_wrapper(&state); } DisconnectAndDestroyAllGangs(false); } diff --git a/src/diskquota.h b/src/diskquota.h index 1ff11164..97796588 100644 --- a/src/diskquota.h +++ b/src/diskquota.h @@ -327,6 +327,6 @@ extern HTAB *DiskquotaShmemInitHash(const char *name, long init_size, long max_s extern void refresh_monitored_dbid_cache(void); extern HASHACTION check_hash_fullness(HTAB *hashp, int max_size, const char *warning_message, TimestampTz *last_overflow_report); -void SPI_connect_my(SPI_state *state); -void SPI_finish_my(const SPI_state *state); +void SPI_connect_wrapper(SPI_state *state); +void SPI_finish_wrapper(const SPI_state *state); #endif diff --git a/src/diskquota_utility.c b/src/diskquota_utility.c index a35441cb..649d7417 100644 --- a/src/diskquota_utility.c +++ b/src/diskquota_utility.c @@ -1239,7 +1239,7 @@ worker_spi_get_extension_version(int *major, int *minor) SPI_state state; int ret; - SPI_connect_my(&state); + SPI_connect_wrapper(&state); ret = SPI_execute("select extversion from pg_extension where extname = 'diskquota'", true, 0); @@ -1284,7 +1284,7 @@ worker_spi_get_extension_version(int *major, int *minor) ret = 0; out: - SPI_finish_my(&state); + SPI_finish_wrapper(&state); return ret; } @@ -1305,7 +1305,7 @@ get_rel_oid_list(bool is_init) List *oidlist = NIL; int ret; - SPI_connect_my(&state); + SPI_connect_wrapper(&state); #define SELECT_FROM_PG_CATALOG_PG_CLASS "select oid from pg_catalog.pg_class where oid >= $1 and relkind in ('r', 'm')" @@ -1353,7 +1353,7 @@ get_rel_oid_list(bool is_init) MemoryContextSwitchTo(oldcontext); } } - SPI_finish_my(&state); + SPI_finish_wrapper(&state); return oidlist; } @@ -1716,7 +1716,7 @@ check_hash_fullness(HTAB *hashp, int max_size, const char *warning_message, Time } void -SPI_connect_my(SPI_state *state) +SPI_connect_wrapper(SPI_state *state) { int rc; @@ -1743,7 +1743,7 @@ SPI_connect_my(SPI_state *state) } void -SPI_finish_my(const SPI_state *state) +SPI_finish_wrapper(const SPI_state *state) { int rc; diff --git a/src/gp_activetable.c b/src/gp_activetable.c index b0869ece..53c89e35 100644 --- a/src/gp_activetable.c +++ b/src/gp_activetable.c @@ -955,7 +955,7 @@ load_table_size(HTAB *local_table_stats_map) Portal portal; char *sql = "select tableid, size, segid from diskquota.table_size"; - SPI_connect_my(&state); + SPI_connect_wrapper(&state); if ((plan = SPI_prepare(sql, 0, NULL)) == NULL) ereport(ERROR, (errmsg("[diskquota] SPI_prepare(\"%s\") failed", sql))); @@ -1031,7 +1031,7 @@ load_table_size(HTAB *local_table_stats_map) SPI_freetuptable(SPI_tuptable); SPI_cursor_close(portal); SPI_freeplan(plan); - SPI_finish_my(&state); + SPI_finish_wrapper(&state); } /* diff --git a/src/quotamodel.c b/src/quotamodel.c index 811f4111..d646b832 100644 --- a/src/quotamodel.c +++ b/src/quotamodel.c @@ -683,7 +683,7 @@ check_diskquota_state_is_ready() */ PG_TRY(); { - SPI_connect_my(&state); + SPI_connect_wrapper(&state); is_ready = do_check_diskquota_state_is_ready(); } PG_CATCH(); @@ -697,7 +697,7 @@ check_diskquota_state_is_ready() RESUME_INTERRUPTS(); } PG_END_TRY(); - SPI_finish_my(&state); + SPI_finish_wrapper(&state); return is_ready; } @@ -1136,12 +1136,12 @@ delete_from_table_size_map(char *str) "delete from diskquota.table_size " "where (tableid, segid) in ( SELECT * FROM deleted_table );", str); - SPI_connect_my(&state); + SPI_connect_wrapper(&state); ret = SPI_execute(delete_statement.data, 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))); - SPI_finish_my(&state); + SPI_finish_wrapper(&state); pfree(delete_statement.data); } @@ -1154,12 +1154,12 @@ insert_into_table_size_map(char *str) initStringInfo(&insert_statement); appendStringInfo(&insert_statement, "insert into diskquota.table_size values %s;", str); - SPI_connect_my(&state); + SPI_connect_wrapper(&state); ret = SPI_execute(insert_statement.data, false, 0); if (ret != SPI_OK_INSERT) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), errmsg("[diskquota] insert_into_table_size_map SPI_execute failed: error code %d", ret))); - SPI_finish_my(&state); + SPI_finish_wrapper(&state); pfree(insert_statement.data); } @@ -1402,7 +1402,7 @@ load_quotas(void) */ PG_TRY(); { - SPI_connect_my(&state); + SPI_connect_wrapper(&state); do_load_quotas(); } PG_CATCH(); @@ -1416,7 +1416,7 @@ load_quotas(void) RESUME_INTERRUPTS(); } PG_END_TRY(); - SPI_finish_my(&state); + SPI_finish_wrapper(&state); return state.do_commit; }