babelfish-for-postgresql / babelfish_extensions

Babelfish for PostgreSQL provides the capability for PostgreSQL to work with applications written for Microsoft SQL Server. Babelfish understands the SQL Server wire-protocol and T-SQL, the Microsoft SQL Server query and procedural language, so you don’t have to switch database drivers or rewrite all of your application queries.
https://babelfishpg.org/
Apache License 2.0
265 stars 87 forks source link

Cross-db reference of sys* catalogs with dbo schema #2679

Open robverschoor opened 1 week ago

robverschoor commented 1 week ago

Description

Cross-database references to the classic sys* catalogs (e.g. sysobjects, syscolumns, syslogins, etc.), while specifying the dbo schema or omitting the schema (e.g. db..sysobjects notation), should not raise an error. For these 'classic' catalogs, referencing the object in dbo or sys schema should be equivalent. This fix addresses the following notations which either raised an error or could return an incorrect value:

- mydb.dbo.sysobjects
- .mydb.dbo.sysobjects
- mydb..sysobjects
- .mydb..sysobjects
- .mydb.sys.sysobjects

- .mydb.dbo.mytable (for non-catalog objects)
- .object (for any object in case the executing user has a non-dbo default schema)

Various existing test cases, which were raising an error previously, had to be adjusted for this fix.

Note: when the executing user has a non-dbo default schema, the case of dbname..object still ignores the default schema, but that is outside the scope of this fix (see BABEL-5050).

Signed-off-by: Rob Verschoor rcv@amazon.com

Issues Resolved

BABEL-5041 Cross-DB system view query is not currently supported in Babelfish

Test Scenarios Covered

Check List

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.

coveralls commented 1 week ago

Pull Request Test Coverage Report for Build 9662150003

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.

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
contrib/babelfishpg_tsql/src/tsqlIface.cpp 55 57 96.49%
<!-- Total: 76 78 97.44% -->
Totals Coverage Status
Change from base Build 9613188327: 0.02%
Covered Lines: 42864
Relevant Lines: 58538

πŸ’› - Coveralls
coveralls commented 1 week ago

Pull Request Test Coverage Report for Build 9663371634

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.

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
contrib/babelfishpg_tsql/src/tsqlIface.cpp 55 57 96.49%
<!-- Total: 76 78 97.44% -->
Totals Coverage Status
Change from base Build 9613188327: 0.02%
Covered Lines: 42864
Relevant Lines: 58538

πŸ’› - Coveralls
coveralls commented 1 week ago

Pull Request Test Coverage Report for Build 9664300569

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.

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
contrib/babelfishpg_tsql/src/tsqlIface.cpp 55 57 96.49%
<!-- Total: 76 78 97.44% -->
Totals Coverage Status
Change from base Build 9613188327: 0.02%
Covered Lines: 42864
Relevant Lines: 58538

πŸ’› - Coveralls
coveralls commented 1 week ago

Pull Request Test Coverage Report for Build 9665690897

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.

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
contrib/babelfishpg_tsql/src/tsqlIface.cpp 55 57 96.49%
<!-- Total: 76 78 97.44% -->
Totals Coverage Status
Change from base Build 9613188327: 0.02%
Covered Lines: 42864
Relevant Lines: 58538

πŸ’› - Coveralls
coveralls commented 1 week ago

Pull Request Test Coverage Report for Build 9668363946

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.

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
contrib/babelfishpg_tsql/src/tsqlIface.cpp 55 57 96.49%
<!-- Total: 76 78 97.44% -->
Totals Coverage Status
Change from base Build 9613188327: 0.02%
Covered Lines: 42864
Relevant Lines: 58538

πŸ’› - Coveralls
coveralls commented 1 week ago

Pull Request Test Coverage Report for Build 9679152338

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.

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
contrib/babelfishpg_tsql/src/tsqlIface.cpp 55 57 96.49%
<!-- Total: 76 78 97.44% -->
Totals Coverage Status
Change from base Build 9613188327: 0.02%
Covered Lines: 42864
Relevant Lines: 58538

πŸ’› - Coveralls
coveralls commented 6 days ago

Pull Request Test Coverage Report for Build 9696366502

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.

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
contrib/babelfishpg_tsql/src/tsqlIface.cpp 55 57 96.49%
<!-- Total: 76 78 97.44% -->
Totals Coverage Status
Change from base Build 9613188327: 0.02%
Covered Lines: 42864
Relevant Lines: 58538

πŸ’› - Coveralls
coveralls commented 6 days ago

Pull Request Test Coverage Report for Build 9697466593

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.

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
contrib/babelfishpg_tsql/src/tsqlIface.cpp 55 57 96.49%
<!-- Total: 76 78 97.44% -->
Totals Coverage Status
Change from base Build 9613188327: 0.02%
Covered Lines: 42866
Relevant Lines: 58538

πŸ’› - Coveralls
coveralls commented 6 days ago

Pull Request Test Coverage Report for Build 9700692011

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.

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
contrib/babelfishpg_tsql/src/tsqlIface.cpp 55 57 96.49%
<!-- Total: 76 78 97.44% -->
Files with Coverage Reduction New Missed Lines %
contrib/babelfishpg_tds/src/backend/tds/tdscomm.c 3 73.33%
<!-- Total: 3 -->
Totals Coverage Status
Change from base Build 9613188327: 0.01%
Covered Lines: 42861
Relevant Lines: 58538

πŸ’› - Coveralls
coveralls commented 5 days ago

Pull Request Test Coverage Report for Build 9709754082

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.

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
contrib/babelfishpg_tsql/src/tsqlIface.cpp 55 57 96.49%
<!-- Total: 76 78 97.44% -->
Files with Coverage Reduction New Missed Lines %
contrib/babelfishpg_tds/src/backend/tds/tdscomm.c 3 73.33%
<!-- Total: 3 -->
Totals Coverage Status
Change from base Build 9613188327: 0.01%
Covered Lines: 42861
Relevant Lines: 58538

πŸ’› - Coveralls