mirror of
https://github.com/percona/pg_stat_monitor.git
synced 2026-02-04 14:06:20 +00:00
PG-161: Miscellaneous small issues.
This commit is contained in:
@@ -397,6 +397,7 @@ pgss_ExecutorEnd(QueryDesc *queryDesc)
|
||||
float utime;
|
||||
float stime;
|
||||
uint64 queryId = queryDesc->plannedstmt->queryId;
|
||||
pgssSharedState *pgss = pgsm_get_ss();
|
||||
|
||||
if (queryId != UINT64CONST(0) && queryDesc->totaltime)
|
||||
{
|
||||
@@ -433,7 +434,8 @@ pgss_ExecutorEnd(QueryDesc *queryDesc)
|
||||
prev_ExecutorEnd(queryDesc);
|
||||
else
|
||||
standard_ExecutorEnd(queryDesc);
|
||||
|
||||
memset(pgss->relations, 0x0, sizeof(pgss->relations));
|
||||
memset(pgss->cmdTag, 0x0, sizeof(pgss->cmdTag));
|
||||
}
|
||||
|
||||
static bool
|
||||
@@ -446,6 +448,7 @@ pgss_ExecutorCheckPerms(List *rt, bool abort)
|
||||
|
||||
LWLockAcquire(pgss->lock, LW_EXCLUSIVE);
|
||||
memset(pgss->cmdTag, 0x0, sizeof(pgss->cmdTag));
|
||||
memset(pgss->relations, 0x0, sizeof(pgss->relations));
|
||||
|
||||
foreach(lr, rt)
|
||||
{
|
||||
@@ -834,10 +837,7 @@ static void pgss_store(uint64 queryId,
|
||||
|
||||
/* Set up key for hashtable search */
|
||||
key.bucket_id = bucket_id;
|
||||
if (elevel == 0)
|
||||
key.userid = GetUserId();
|
||||
else
|
||||
key.userid = 1;
|
||||
key.userid = GetUserId();
|
||||
key.dbid = MyDatabaseId;
|
||||
key.queryid = queryId;
|
||||
key.ip = pg_get_client_addr();
|
||||
@@ -943,6 +943,7 @@ static void pgss_store(uint64 queryId,
|
||||
for (i = 0; i < application_name_len; i++)
|
||||
e->counters.info.application_name[i] = application_name[i];
|
||||
|
||||
found = false;
|
||||
for (i = 0; i < REL_LST; i++)
|
||||
if (e->counters.info.relations[i] != 0)
|
||||
found = true;
|
||||
|
||||
Reference in New Issue
Block a user