PG-221: Use alternat of GetUserID function in error hook.

pull/99/head
Ibrar Ahmed 2021-08-31 12:10:11 +00:00
parent bdab22e7cc
commit aee45ebe52
1 changed files with 6 additions and 2 deletions

View File

@ -1477,7 +1477,8 @@ pgss_store(uint64 queryid,
int application_name_len = pg_get_application_name(application_name);
bool reset = false;
uint64 bucketid;
uint64 userid = GetUserId();
uint64 userid;
int con;
uint64 dbid = MyDatabaseId;
uint64 ip = pg_get_client_addr();
uint64 planid = plan_info ? plan_info->planid: 0;
@ -1488,6 +1489,9 @@ pgss_store(uint64 queryid,
return;
Assert(query != NULL);
GetUserIdAndSecContext((unsigned int *)&userid, &con);
if (userid == 0)
return;
comments = extract_query_comments(query);
@ -3496,4 +3500,4 @@ void update_hook_stats(enum pg_hook_stats_id hook_id, double time_elapsed)
p->total_time += time_elapsed;
p->ncalls++;
}
#endif
#endif