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

babelfish-for-postgresql / babelfish_extensions / 26519349733
77%

Build:
DEFAULT BRANCH: BABEL_6_X_DEV
Ran 27 May 2026 03:24PM UTC
Jobs 1
Files 128
Run time 3min
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

27 May 2026 02:59PM UTC coverage: 76.986% (+0.05%) from 76.933%
26519349733

push

github

web-flow
Add support for FOR XML AUTO mode (#4834)

This commit adds support for FOR XML AUTO query. With this change, AUTO mode generates hierarchical XML
where element names and nesting are derived from the table aliases in the SELECT. This commit also supports all
existing directives (ELEMENTS, XSINIL, ROOT) and works with JOINs, CTEs, subqueries, functions, and views.

Implementation summary:

- For each entry in the SELECT target list, parser-side rewrite captures (nest_level, table_alias, col_name) and threads this metadata as a 9th text argument to both FOR XML aggregates (tsql_select_for_xml_agg, tsql_select_for_xml_text_agg). The metadata string is a comma-separated list of "level.table_alias.col_name" entries, e.g. "1.c.CustomerID,1.c.Name,2.o.OrderID,2.o.Amount" for a query joining customer (alias c) and order (alias o).

- Hierarchy is built row-by-row by the aggregate state function. It tracks last-seen values per column and finds
the first column whose value differs from the previous row - that column's nest_level becomes the "first changed
level". The aggregate closes any open elements deeper than that level and opens new elements for every level
from that point down. Sibling rows that share their parent's value get merged under the same parent element.

- Performance: since column types don't change between rows, type output functions (FmgrInfo) and T-SQL
datatype-detection results are cached on the first row to skip catalog (syscache) lookups on every subsequent
value.

Task: BABEL-1151
Signed-off-by: Japleen Kaur <amjj@amazon.com>

538 of 618 new or added lines in 3 files covered. (87.06%)

3 existing lines in 2 files now uncovered.

54318 of 70556 relevant lines covered (76.99%)

606628.84 hits per line

Uncovered Changes

Lines Coverage ∆ File
50
89.58
-4.84% contrib/babelfishpg_tsql/src/tsql_for/forxml.c
30
90.44
-0.49% contrib/babelfishpg_tsql/src/pl_handler.c

Coverage Regressions

Lines Coverage ∆ File
2
89.58
-4.84% contrib/babelfishpg_tsql/src/tsql_for/forxml.c
1
90.44
-0.49% contrib/babelfishpg_tsql/src/pl_handler.c
Jobs
ID Job ID Ran Files Coverage
1 26519349733.1 27 May 2026 03:24PM UTC 128
76.99
GitHub Action Run
Source Files on build 26519349733
  • Tree
  • List 128
  • Changed 4
  • Source Changed 4
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #26519349733
  • 1812e00b on github
  • Prev Build on BABEL_6_X_DEV (#26463101191)
  • 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