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

Fix crash in sp_describe_undeclared_parameters #2687

Closed ahmed-shameem closed 1 week ago

ahmed-shameem commented 1 week ago

Description

In our previous attempt of fixing sp_describe_undeclared_parameters related crash, we missed some corner cases where few variables will be left NULL if is_sp_describe_undeclared_parameters is marked as false. Then when we try to access those variables, we get seg fault. In this commit, we fix it by adding extra check on is_sp_describe_undeclared_parameters.

Issues Resolved

BABEL-5068 Signed-off-by: Shameem Ahmed shmeeh@amazon.com

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 9673447216

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
contrib/babelfishpg_tsql/src/procedures.c 53 64 82.81%
<!-- Total: 53 64 82.81% -->
Files with Coverage Reduction New Missed Lines %
contrib/babelfishpg_tsql/src/procedures.c 135 88.69%
<!-- Total: 135 -->
Totals Coverage Status
Change from base Build 9646270885: -0.001%
Covered Lines: 42277
Relevant Lines: 57875

πŸ’› - Coveralls
coveralls commented 1 week ago

Pull Request Test Coverage Report for Build 9673673101

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
contrib/babelfishpg_tsql/src/procedures.c 60 72 83.33%
<!-- Total: 60 72 83.33% -->
Files with Coverage Reduction New Missed Lines %
contrib/babelfishpg_tsql/src/procedures.c 2 88.44%
<!-- Total: 2 -->
Totals Coverage Status
Change from base Build 9646270885: -0.006%
Covered Lines: 42280
Relevant Lines: 57883

πŸ’› - Coveralls
coveralls commented 1 week ago

Pull Request Test Coverage Report for Build 9675383012

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/procedures.c 62 73 84.93%
<!-- Total: 62 73 84.93% -->
Files with Coverage Reduction New Missed Lines %
contrib/babelfishpg_tsql/src/procedures.c 82 88.32%
<!-- Total: 82 -->
Totals Coverage Status
Change from base Build 9646270885: -0.01%
Covered Lines: 42278
Relevant Lines: 57883

πŸ’› - Coveralls
coveralls commented 1 week ago

Pull Request Test Coverage Report for Build 9675472802

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/procedures.c 63 74 85.14%
<!-- Total: 63 74 85.14% -->
Files with Coverage Reduction New Missed Lines %
contrib/babelfishpg_tsql/src/procedures.c 5 88.33%
<!-- Total: 5 -->
Totals Coverage Status
Change from base Build 9646270885: -0.005%
Covered Lines: 42282
Relevant Lines: 57885

πŸ’› - Coveralls