Fix toplevel calculation for older PG version

pull/463/head
Artem Gavrilov 2024-06-11 15:17:38 +02:00
parent 267591677e
commit b0aa23f819
1 changed files with 4 additions and 0 deletions

View File

@ -1818,7 +1818,11 @@ pgsm_create_hash_entry(uint64 bucket_id, uint64 queryid, PlanInfo * plan_info)
#if PG_VERSION_NUM < 140000
entry->key.toplevel = 1;
#else
#if PG_VERSION_NUM >= 170000
entry->key.toplevel = ((nesting_level) == 0);
#else
entry->key.toplevel = ((nesting_level + plan_nested_level) == 0);
#endif
#endif
if (IsTransactionState())