• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

babelfish-for-postgresql / babelfish_extensions / 12350160541
76%
BABEL_5_X_DEV: 77%

Build:
Build:
LAST BUILD BRANCH: fix_script_injection
DEFAULT BRANCH: BABEL_5_X_DEV
Ran 16 Dec 2024 10:29AM UTC
Jobs 1
Files 115
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

16 Dec 2024 09:57AM UTC coverage: 74.855% (+0.02%) from 74.832%
12350160541

push

github

web-flow
Fix the nvarchar-varbinary casting (#3072)

PROBLEM: while casting nvarchar to varbinary we were considering the UTF8 encoding as input encoding in Babelfish
where as in TSQL we use UTF16 encoding fir nvarchar irrespective of input encoding.

RCA: we were considering varchar and nvarchar as same, whereas we should use input encoding for varchar and UTF16
encoding for nvarchar.

FIX: So we need to identify that if the input is nvarchar then we will do the UTF16 encoding.

For a casting like nvarchar->varbinary->nvarchar, now since for the casting we are encoding the input string into UTF16
encoding via function nvarcharvarbinary, so while converting varbinary-> nvarchar we will use the function
varbinarynvarchar where we will convert UTF16 encoding to UTF8 with null padding.

So we created a function nvarcharvarbinary and varbinarynvarchar to handle nvarchar<-> varbinary to and fro casting.
And for this casting we have specifically applied a condition that we will not convert the datatype to basetype before choosing the casting function

Task: BABEL-4891
Signed-off-by: Pranav Jain <pranavjc@amazon.com>

148 of 183 new or added lines in 3 files covered. (80.87%)

46661 of 62335 relevant lines covered (74.86%)

164208.35 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
8
80.87
1.27% contrib/babelfishpg_common/src/varbinary.c
27
83.23
-2.73% contrib/babelfishpg_common/src/varchar.c
Jobs
ID Job ID Ran Files Coverage
1 12350160541.1 16 Dec 2024 10:29AM UTC 115
74.86
GitHub Action Run
Source Files on build 12350160541
  • Tree
  • List 115
  • Changed 79
  • Source Changed 3
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #12350160541
  • 3e2c11d7 on github
  • Prev Build on BABEL_4_X_DEV (#12347282962)
  • Next Build on BABEL_4_X_DEV (#12353582929)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc