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

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

Build:
Build:
LAST BUILD BRANCH: fix_script_injection
DEFAULT BRANCH: BABEL_5_X_DEV
Ran 30 Sep 2024 01:29PM 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

30 Sep 2024 12:56PM UTC coverage: 74.505% (+0.001%) from 74.504%
11106562150

push

github

web-flow
Modify APIs to return palloc'ed values and catalog lookup to validate the user in get_physical_user_name (#2960)

Earlier in Babelfish, The get_*_role_name() and get_*_schema_name() APIs returned constant values or string literal for
few cases and palloc'ed copy for other cases. The get_physical_user_name() used to return the user_name after
appending the db_name to the user_name without any checks to verify its existence/validity.

With this change, We return Palloc'ed values for the API every time. In get_physical_user_name() if the user or role is
not found in the sys.babelfish_authid_user_ext catalog, then an error is thrown. Additionally, In multidb.c, made
changes to the APIs like get_role_name() and get_schema_name() to return palloc'ed values instead of constant
values. 

Implemented a catalog lookup in get_physical_user_name() to verify if the user or role is found in the
sys.babelfish_authid_user_ext catalog. The 'suppress_role_error' flag indicates if it is ok for the user or role to be
absent from the catalog (required for cases when a new user/role is created and it can't be found in the catalog).

Checked all the functions where the APIs are called and pfree the variables containing values from the above APIs after they are no longer used.

Task: BABEL-4933
Signed-off-by: P Aswini Kumar <aswinii@amazon.com>

142 of 162 new or added lines in 11 files covered. (87.65%)

7 existing lines in 4 files now uncovered.

45062 of 60482 relevant lines covered (74.5%)

162407.76 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
87.22
0.04% contrib/babelfishpg_tsql/src/catalog.c
2
75.1
-0.05% contrib/babelfishpg_tsql/src/dbcmds.c
3
83.32
-0.09% contrib/babelfishpg_tsql/runtime/functions.c
5
83.33
-0.2% contrib/babelfishpg_tsql/src/rolecmds.c
8
79.34
-0.69% contrib/babelfishpg_tsql/src/multidb.c

Uncovered Existing Lines

Lines Coverage ∆ File
1
87.22
0.04% contrib/babelfishpg_tsql/src/catalog.c
1
83.33
-0.2% contrib/babelfishpg_tsql/src/rolecmds.c
2
76.03
-0.63% contrib/babelfishpg_tds/src/backend/tds/tdscomm.c
3
83.32
-0.09% contrib/babelfishpg_tsql/runtime/functions.c
Jobs
ID Job ID Ran Files Coverage
1 11106562150.1 30 Sep 2024 01:29PM UTC 115
74.5
GitHub Action Run
Source Files on build 11106562150
  • Tree
  • List 115
  • Changed 45
  • Source Changed 12
  • Coverage Changed 12
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #11106562150
  • 1550114e on github
  • Prev Build on BABEL_4_X_DEV (#11105860459)
  • Next Build on BABEL_4_X_DEV (#11109596996)
  • 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