babelfish_extensions icon indicating copy to clipboard operation
babelfish_extensions copied to clipboard

Fix the logic of calculating the length of the named procedure to consider characters position instead of bytes

Open Deepesh125 opened this issue 1 year ago • 1 comments

Description

Previously, string.length() method was being used to calculate the length of named procedure inside makeExecuteProcedure. This method calculates length in terms of bytes. For example, length of "ZERO WIDTH SPACE" with unicode point U+200B will be computed as 3 which was causing certain assertion failure makeExecuteProcedure resulting in crash. But as far as parser and token's position concerns, we should really care of character position instead of bytes position.

This commit aims to fix this issue by fixing logic of calculating the length of named procedure by using getStartIndex() and getStopIndex() of the procedure token.

Task: BABEL-4961 Signed-off-by: Dipesh Dhameliya [email protected]

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.

Deepesh125 avatar May 16 '24 13:05 Deepesh125

Pull Request Test Coverage Report for Build 9123019705

Details

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.006%) to 72.775%

Totals Coverage Status
Change from base Build 9111092279: 0.006%
Covered Lines: 41816
Relevant Lines: 57459

💛 - Coveralls

coveralls avatar May 17 '24 04:05 coveralls