fix issue with incorrect precision and scale value is computed of constant with value 0
Description
Currently when typmod information is computed of a constant using numeric_get_typmod function, it returns precision = 18 and scale = 0 when constant value is 0 irrespective of its scale. Although this should be the case only if constant value is 0 and its scale is also 0. Fixed this logic by adding a check on scale.
Issues Resolved
BABEL-5655
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.
Pull Request Test Coverage Report for Build 13978828292
Details
- 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
- 2 unchanged lines in 1 file lost coverage.
- Overall coverage decreased (-0.003%) to 75.038%
| Files with Coverage Reduction | New Missed Lines | % |
|---|---|---|
| contrib/babelfishpg_tds/src/backend/tds/tdscomm.c | 2 | 76.03% |
| <!-- | Total: | 2 |
| Totals | |
|---|---|
| Change from base Build 13968599311: | -0.003% |
| Covered Lines: | 47542 |
| Relevant Lines: | 63357 |