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

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

Build:
Build:
LAST BUILD BRANCH: fix_script_injection
DEFAULT BRANCH: BABEL_5_X_DEV
Ran 23 Apr 2024 07:06AM UTC
Jobs 1
Files 114
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

23 Apr 2024 06:27AM UTC coverage: 72.52% (-0.01%) from 72.534%
8795835939

push

github

web-flow
Support unique constraints on nullable column with nulls not distinct (#2518)

Currently babelfish has supported UNIQUE indexes/constraints under the escape hatch 'escape_hatch_unique_constraint'. This is because the current implementation allows duplicate NULL values in a column even when there is a UNIQUE constraint on it.
While the correct expected behaviour for pltsql UNIQUE indexes should be to treat NULL values as NOT DISTINCT. So only one NULL value should be allowed in UNIQUE index. (reject duplicate nulls in column)
We use PGs null not distinct option on column definition to implement this. So pltsql UNIQUE COLUMN CONSTRAINT and CREATE UNIQUE INDEX would implicitly have the nulls not distinct option and only single NULL value will be allowed.

For UNIQUE COLUMN CONSTRAINT we re-write the query string in ANTLR parser while for CREATE INDEX we use the bison parser.

This PR also includes fix for NULLS ordering for UNIQUE indexes created through table or column constraints. Refer engine PR for more information.
Also INLINE INDEX is not currently supported and should throw unsupported error. Test cases added in BABEL-UNSUPPORTED
Remove the escape hatch 'escape_hatch_unique_constraint' since it is no longer needed.

Issues Resolved
[BABEL-3571]


Signed-off-by: Tanzeel Khan <tzlkhan@amazon.com>

25 of 28 new or added lines in 3 files covered. (89.29%)

1 existing line in 1 file now uncovered.

41127 of 56711 relevant lines covered (72.52%)

65013.74 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
3
79.88
-0.02% contrib/babelfishpg_tsql/src/hooks.c

Uncovered Existing Lines

Lines Coverage ∆ File
1
91.39
-0.26% contrib/babelfishpg_tsql/src/pl_handler.c
Jobs
ID Job ID Ran Files Coverage
1 8795835939.1 23 Apr 2024 07:06AM UTC 114
72.52
GitHub Action Run
Source Files on build 8795835939
  • Tree
  • List 114
  • Changed 71
  • Source Changed 5
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #8795835939
  • 9c7cc60c on github
  • Prev Build on BABEL_4_X_DEV (#8784169253)
  • Next Build on BABEL_4_X_DEV (#8802574348)
  • 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