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

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

Build:
Build:
LAST BUILD BRANCH: BABEL_4_X_DEV
DEFAULT BRANCH: BABEL_5_X_DEV
Ran 10 Oct 2024 12:55PM 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

10 Oct 2024 12:06PM UTC coverage: 74.49% (+0.02%) from 74.475%
11273659322

push

github

web-flow
Fixed UDT handling for CASE statement when branch expression is of String Datatype. (#3009)

In CASE expression if we use UDT or sysname in any of the branch, there was no handling to find overall common type
and common typmod for CASE statement. For example, 

create type BABEL_CASE_EXPR_TEST_UDT from NVARCHAR(100);
GO

SELECT 
CASE 2
   WHEN 1 THEN 'abc'
   WHEN 2 THEN CAST('char' AS BABEL_CASE_EXPR_TEST_UDT)
END AS RESULT
GO

output:

Msg 8152, Level 16, State 1, Server BABELFISH, Line 1
value too long for type character varying(3)

Expected output:

nvarchar
char

Changes made to fix the issues - 

We added handling for UDT and sysname for CASE Expression. While finding common type of CASE Expression, we
checked if the following branch is a UDT or not, if yes then find the immediate base_type of UDT and find the TSQL
precedence according to the immediate base_type. If the branch if of type SYSNAME then we directly assign varchar as
datatype for that branch. While finding the common_typmod of CASE Expression, We checked if the branch is a UDT or
not, if yes then find the typmod of the base_type using getBaseTypeAndTypmod().If one of the branch is
of type SYSNAME then set typmod as SYSNAME_TYPMOD (i.e. 128).

Task: BABEL-5103, BABEL-4332
Signed-off-by: yashneet vinayak <yashneet@amazon.com>

34 of 35 new or added lines in 3 files covered. (97.14%)

45161 of 60627 relevant lines covered (74.49%)

162184.3 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
82.07
0.45% contrib/babelfishpg_tsql/src/pltsql_coerce.c
Jobs
ID Job ID Ran Files Coverage
1 11273659322.1 10 Oct 2024 12:55PM UTC 115
74.49
GitHub Action Run
Source Files on build 11273659322
  • Tree
  • List 115
  • Changed 68
  • Source Changed 3
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #11273659322
  • 8866c9f3 on github
  • Prev Build on BABEL_4_X_DEV (#11256391296)
  • Next Build on BABEL_4_X_DEV (#11290454460)
  • 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

© 2025 Coveralls, Inc