Typmod handling for functions expression with numeric.
Issue
In resolve_numeric_typmod_from_exp we missed the handling for typmod calculation for some mathematical functions in function expression like ROUND(), POWER(), CEILING(), FLOOR(), SIGN(), ABS(), DEGREES(), RADAINS(), SCOPE_IDENTITY(), IDENT_SEED(), IDENT_INCR(), IDENT_CURRENT().
2. Changes made to fix the issues
Added handling for ROUND(), POWER(), CEILING(), FLOOR(), SIGN(), ABS(), DEGREES(), RADAINS(), SCOPE_IDENTITY(), IDENT_SEED(), IDENT_INCR(), IDENT_CURRENT() mathematical functions in T_FuncExpr node
Issues Resolved
Task: BABEL-5666
cherry-picked from https://github.com/babelfish-for-postgresql/babelfish_extensions/pull/3868
Authored-by: yashneet vinayak [email protected] Signed-off-by: yashneet vinayak [email protected]
Test Scenarios Covered
-
Use case based - YES
-
Boundary conditions - YES
-
Arbitrary inputs - YES
-
Negative test cases - YES
-
Minor version upgrade tests -
-
Major version upgrade tests -
-
Performance tests -
-
Tooling impact -
-
Client tests -
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 16143205220
Details
- 99 of 103 (96.12%) changed or added relevant lines in 3 files are covered.
- 1 unchanged line in 1 file lost coverage.
- Overall coverage increased (+0.03%) to 75.568%
| Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
|---|---|---|---|
| contrib/babelfishpg_tsql/src/pltsql_coerce.c | 89 | 93 | 95.7% |
| <!-- | Total: | 99 | 103 |
| Files with Coverage Reduction | New Missed Lines | % |
|---|---|---|
| contrib/babelfishpg_tds/src/backend/tds/tdsresponse.c | 1 | 79.08% |
| <!-- | Total: | 1 |
| Totals | |
|---|---|
| Change from base Build 16108808624: | 0.03% |
| Covered Lines: | 49339 |
| Relevant Lines: | 65291 |