sp_rename is not updating function/procedure name in babelfish_schema_permissions catalog
Description
Currently, if we create procedures and functions in system databases such as master and rename those objects using sp_rename, their entries in the babelfish_schema_permissions catalog is not updated. This is because we were using the physical schema name to do the catalog lookup which would work if we were using a user defined T-SQL database in single-db mode.
In this commit, after we get the physical schema name of the procedure or function, we extract the logical schema name and then use that name to do the catalog lookup in babelfish_schema_permissions.
Task: BABEL-4768 Signed-off-by: Sharu Goel [email protected]
Test Scenarios Covered
-
Use case based - Yes
-
Boundary conditions - N/A
-
Arbitrary inputs - N/A
-
Negative test cases - N/A
-
Minor version upgrade tests - Yes
-
Major version upgrade tests - Yes
-
Performance tests - N/A
-
Tooling impact - N/A
-
Client tests - N/A
Check List
- [x] Commits are signed per the DCO using --signoff
By submitting this pull request, I confirm that my contribution is under the terms of the Apache 2.0 and PostgreSQL licenses, and grant any person obtaining a copy of the contribution permission to relicense all or a portion of my contribution to the PostgreSQL License solely to contribute all or a portion of my contribution to the PostgreSQL open source project.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.
Pull Request Test Coverage Report for Build 7900997282
Warning: This coverage report may be inaccurate.
This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
- For more information on this, see Tracking coverage changes with pull request builds.
- To avoid this issue with future PRs, see these Recommended CI Configurations.
- For a quick fix, rebase this PR at GitHub. Your next report should be accurate.
Details
- -7 of 7 (0.0%) changed or added relevant lines in 2 files are covered.
- 20959 unchanged lines in 95 files lost coverage.
- Overall coverage decreased (-36.9%) to 35.967%
| Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
|---|---|---|---|
| contrib/babelfishpg_tsql/src/pl_handler.c | 0 | 2 | 0.0% |
| contrib/babelfishpg_tsql/src/catalog.c | 0 | 5 | 0.0% |
| <!-- | Total: | 0 | 7 |
| Files with Coverage Reduction | New Missed Lines | % |
|---|---|---|
| contrib/babelfishpg_tds/src/backend/tds/tdscomm.c | 1 | 73.1% |
| contrib/babelfishpg_tds/src/backend/tds/tds_srv.c | 1 | 88.98% |
| contrib/babelfishpg_tds/src/include/tds_request.h | 1 | 73.8% |
| contrib/babelfishpg_tsql/src/collationproperty.c | 1 | 92.86% |
| contrib/babelfishpg_common/src/encoding/mb/conversion_procs/utf8_and_uhc/utf8_and_uhc.c | 2 | 0.0% |
| contrib/babelfishpg_tds/src/backend/tds/err_handler.c | 2 | 73.79% |
| contrib/babelfishpg_tsql/src/pltsql_function_probin_handler.c | 2 | 94.01% |
| contrib/babelfishpg_tds/src/backend/tds/tdsprotocol.c | 3 | 62.54% |
| contrib/babelfishpg_tsql/src/pl_comp-2.c | 3 | 89.29% |
| contrib/babelfishpg_common/src/encoding/mb/conversion_procs/utf8_and_gbk/utf8_and_gbk.c | 4 | 0.0% |
| <!-- | Total: | 20959 |
| Totals | |
|---|---|
| Change from base Build 7879362846: | -36.9% |
| Covered Lines: | 20281 |
| Relevant Lines: | 56388 |