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

amazon-aurora / babelfish_extensions / 25793051649 / 1
76%
main: 77%

Build:
Build:
LAST BUILD BRANCH: jira-babel-ssms-perf
DEFAULT BRANCH: main
Ran 13 May 2026 10:59AM UTC
Files 120
Run time 9s
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

04 May 2026 04:58PM UTC coverage: 76.341% (+2.7%) from 73.674%
25793051649.1

push

github

web-flow
Fix sql_variant type resolution in CASE, UNION, INTERSECT, EXCEPT, VALUES, and COALESCE expressions (#4792)

Expressions fail when sql_variant is mixed with other types in type-resolution contexts:

-- CASE: fails
SELECT CASE WHEN 1 = 1 THEN SERVERPROPERTY('IsFullTextInstalled') ELSE CAST(0 AS bit) END;
-- Error: CASE/WHEN could not convert type sql_variant to "bit"
-- COALESCE: fails
SELECT COALESCE(CAST(NULL AS sql_variant), CAST('hello' AS varchar(50)));
-- Error: COALESCE could not convert type sql_variant to "varchar"
The same class of issue affects UNION, INTERSECT, EXCEPT, and VALUES when sql_variant is mixed with non-char types.

Fix
select_common_type_setop - Added a pre-scan before the main loop: if any expression is sql_variant, return it immediately as the common type. This applies to all contexts routed through this function (CASE, UNION, INTERSECT, EXCEPT, VALUES). sql_variant has the highest TSQL precedence (0) and can hold any type, so it always wins.

select_common_type_for_coalesce_function - In the NULL-skipping logic, if the NULL arg's type is sql_variant, still consider it for precedence before continuing.

Both fixes use is_tsql_sqlvariant_datatype to narrowly target only sql_variant. No other types or code paths are affected.

select_common_type_for_coalesce_function also includes a minor cleanup: the UNKNOWNOID (string literal) handling was simplified by replacing ptype in-place and falling through to the shared precedence comparison, instead of duplicating the comparison inline with a separate continue. This is semantically equivalent and notstrictly required for the sql_variant fix.

Tasks:
BABEL-6402
BABEL-6427

(cherry-picked from #4706)

signed-off-by: Mohit Raj mrxmohit@amazon.com

50810 of 66557 relevant lines covered (76.34%)

399267.91 hits per line

Source Files on job 25793051649.1
  • Tree
  • List 120
  • Changed 77
  • Source Changed 0
  • Coverage Changed 77
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 25793051649
  • d59aa270 on github
  • Prev Job for on merge-16.4 (#10357611663.1)
  • 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