Summary:
Transactional DDL introduces the ability to run DDL as part of the transaction block similar to DMLs. Before the feature, DDL used to run in autonomous transactions and commit independently from the overall transaction block it was part of.
This revision enables transactional DDL in TestPgRegressPlpgsql and fixes it. The bug was in the function `YBGetActiveCatalogCacheVersion`. This function returns `yb_catalog_cache_version + 1` if the current statement is a DDL. To detect if the current statement is a DDL, it used `YBGetDdlNestingLevel() > 0` which is no longer applicable with transactional DDL.
This revision updates the function `YBGetActiveCatalogCacheVersion` to use `YBIsCurrentStmtDdl` if transactional ddl is enabled.
Jira: DB-17619
Test Plan: ./yb_build.sh --java-test 'org.yb.pgsql.TestPgRegressPlpgsql#testPgRegressPlpgsql'
Reviewers: myang, #db-approvers
Reviewed By: myang, #db-approvers
Subscribers: svc_phabricator, yql
Differential Revision: https://phorge.dev.yugabyte.com/D47061