Fix toplevel calculation for older PG version

This commit is contained in:
Artem Gavrilov
2024-06-11 15:17:38 +02:00
parent 267591677e
commit b0aa23f819

View File

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