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

babelfish-for-postgresql / babelfish_extensions / 28355359713
77%

Build:
DEFAULT BRANCH: BABEL_6_X_DEV
Ran 29 Jun 2026 07:47AM UTC
Jobs 1
Files 128
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

29 Jun 2026 07:19AM UTC coverage: 77.466% (+0.001%) from 77.465%
28355359713

push

github

web-flow
Fix for infinite recursion for CAST Convert to String to fail And DATETRUNC to fail during DnR  (#4854)

sys._trunc_numeric_to_int4 / _int8 and _int2 variants causes infinite recursion and stack overflow when called during dump/restore for tables with CAST(DECIMAL AS INT).

The error Repro - #4851 , #4857

During dump/restore, babelfishpg_tsql.dump_restore is set to on, which activates the find_coercion_pathway_hook. This hook overrides PostgreSQL's standard cast resolution for numeric to
integer types, routing them through the Babelfish truncation functions (sys._trunc_numeric_to_int* ). These functions internally use CAST(trunc(arg) AS INT*), which triggers the same hook again leadind to infinite recursion.

For the datetrunc it fails because the sys schema isn't in search_path during DnR. The type datetime lives in sys schema without sys in the path, PG can't find it.
So changed datetime -> sys.datetime and similar for other

For the Issue with CONVERT-
The reasons-

substring(text, pattern) → picks substring(text, int) instead of (text, text) → tries to parse the regex as int.
regexp_replace-> picks (text,text,text,int) over (text,text,text,text) → tries to parse 'gi' as int.
col IN (CHAR,VARCHAR) → the IN-list array's common type is resolved to float8 instead of text
A better fix for these similar issues would be a C level fix in find_coercion_pathway . But this fix unblocks the problem with - #4826 (which crashes for table with datetrunc and CAST in computed column)'

Issues Resolved
BABEL-6813 and BABEL-6815

---------

Co-authored-by: Ayush-061 <ayushhx@amazon.com>

56053 of 72358 relevant lines covered (77.47%)

578917.64 hits per line

Jobs
ID Job ID Ran Files Coverage
1 28355359713.1 29 Jun 2026 07:47AM UTC 128
77.47
GitHub Action Run
Source Files on build 28355359713
  • Tree
  • List 128
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #28355359713
  • cc424a6a on github
  • Prev Build on BABEL_6_X_DEV (#28080872713)
  • 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