PG-576 - Segmentation fault caused by pg_stat_monitor unique
queryid creation mechanism. Resolving the crash identified by regression and reported by Naeem. This fix resolves the issue with incorrect query length in case of normalized query when the query length exceeds PGSM_QUERY_MAX_LEN. Resolving the crash identify by regression and reported by Naeem.pull/344/head
parent
b60eece145
commit
f170322f38
|
@ -1520,7 +1520,11 @@ pgss_store(uint64 queryid,
|
|||
pgsm_query_id = pgss_hash_string(norm_query, norm_query_len);
|
||||
|
||||
/* Free up norm_query if we don't intend to show normalized version in the view */
|
||||
if (!PGSM_NORMALIZED_QUERY)
|
||||
if (PGSM_NORMALIZED_QUERY)
|
||||
{
|
||||
query_len = norm_query_len;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (norm_query)
|
||||
pfree(norm_query);
|
||||
|
@ -1559,7 +1563,7 @@ pgss_store(uint64 queryid,
|
|||
queryid,
|
||||
pgss_qbuf,
|
||||
norm_query ? norm_query : query,
|
||||
norm_query ? norm_query_len : query_len,
|
||||
query_len,
|
||||
&query_entry->query_pos))
|
||||
{
|
||||
LWLockRelease(pgss->lock);
|
||||
|
|
Loading…
Reference in New Issue