Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with sp_tables failing for cross-database table qualifiers (#2961) #2984

Conversation

roshan0708
Copy link
Contributor

@roshan0708 roshan0708 commented Sep 27, 2024

Description

This is a cherry-pick commit of #2961.

Issues Resolved

Task: BABEL-5263

Test Scenarios Covered

  • Use case based -

  • Boundary conditions -

  • Arbitrary inputs -

  • Negative test cases -

  • Minor version upgrade tests -

  • Major version upgrade tests -

  • Performance tests -

  • Tooling impact -

  • Client tests -

Check List

  • 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.

…abelfish-for-postgresql#2961)

This change fixes an issue with the sp_tables stored procedure, which incorrectly handled three-part object names across databases, throwing an error regarding database context. The root cause was sys.db_name() returning the wrong database name based on the object qualifier.

The issue affected the usability of linked servers in Babelfish, as it prevented accurate metadata retrieval, limiting compatibility with SQL Server.

The fix replaced sys.db_name() with a direct SELECT sys.db_name() to fetch the correct database name before comparing it against the table_qualifier.

Task: BABEL-5263

Signed-off-by: Roshan Kanwar <[email protected]>
@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 11070700113

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 73.685%

Totals Coverage Status
Change from base Build 11070088791: 0.0%
Covered Lines: 42819
Relevant Lines: 58111

💛 - Coveralls

@shardgupta shardgupta merged commit 0b229b1 into babelfish-for-postgresql:BABEL_3_X_DEV Sep 27, 2024
43 checks passed
@shardgupta shardgupta deleted the JIRA-BABEL-5263-3x branch September 27, 2024 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants