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.
Currently for string function STRING_AGG() we are directly using corresponding PG function whose input and output datatype is TEXT. This leads to incorrect output for input containing multi-byte characters with nchar and nvarchar datatype. This PR will fix this issue by adding wrapper functions with correct input and return datatype for STRING_AGG() function.
[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.
Description
Currently for string function
STRING_AGG()
we are directly using corresponding PG function whose input and output datatype isTEXT
. This leads to incorrect output for input containing multi-byte characters withnchar
andnvarchar
datatype. This PR will fix this issue by adding wrapper functions with correct input and return datatype forSTRING_AGG()
function.Cherry-picked from: https://github.com/babelfish-for-postgresql/babelfish_extensions/pull/2869
Authored-by: Rohit Bhagat rohitbgt@amazon.com Signed-off-by: Rohit Bhagat rohitbgt@amazon.com
Issues Resolved
BABEL-5156
Test Scenarios Covered
Use case based - YES
Boundary conditions - YES
Arbitrary inputs - YES
Negative test cases - YES
Minor version upgrade tests - YES
Major version upgrade tests - YES
Performance tests - NO
Tooling impact - NO
Client tests - NO
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.