mirror of
https://github.com/percona/pg_stat_monitor.git
synced 2026-02-04 05:56:21 +00:00
Fix nesting level counting for older PG version
This commit is contained in:
@@ -1233,6 +1233,8 @@ pgsm_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
|
|||||||
* To be absolutely certain we don't mess up the nesting level,
|
* To be absolutely certain we don't mess up the nesting level,
|
||||||
* evaluate the bump_level condition just once.
|
* evaluate the bump_level condition just once.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if PG_VERSION_NUM >= 17000
|
||||||
bool bump_level =
|
bool bump_level =
|
||||||
!IsA(parsetree, ExecuteStmt) &&
|
!IsA(parsetree, ExecuteStmt) &&
|
||||||
!IsA(parsetree, PrepareStmt) &&
|
!IsA(parsetree, PrepareStmt) &&
|
||||||
@@ -1243,6 +1245,8 @@ pgsm_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
|
|||||||
|
|
||||||
PG_TRY();
|
PG_TRY();
|
||||||
{
|
{
|
||||||
|
#endif
|
||||||
|
|
||||||
#if PG_VERSION_NUM >= 140000
|
#if PG_VERSION_NUM >= 140000
|
||||||
if (prev_ProcessUtility)
|
if (prev_ProcessUtility)
|
||||||
prev_ProcessUtility(pstmt, queryString,
|
prev_ProcessUtility(pstmt, queryString,
|
||||||
@@ -1279,6 +1283,8 @@ pgsm_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
|
|||||||
dest,
|
dest,
|
||||||
completionTag);
|
completionTag);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if PG_VERSION_NUM >= 17000
|
||||||
if (bump_level)
|
if (bump_level)
|
||||||
nesting_level--;
|
nesting_level--;
|
||||||
}
|
}
|
||||||
@@ -1290,6 +1296,7 @@ pgsm_ProcessUtility(PlannedStmt *pstmt, const char *queryString,
|
|||||||
}
|
}
|
||||||
PG_END_TRY();
|
PG_END_TRY();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if PG_VERSION_NUM < 130000
|
#if PG_VERSION_NUM < 130000
|
||||||
|
|||||||
Reference in New Issue
Block a user