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

babelfish-for-postgresql / babelfish_extensions / 12375565970
77%

Build:
DEFAULT BRANCH: BABEL_5_X_DEV
Ran 17 Dec 2024 03:31PM 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

17 Dec 2024 02:57PM UTC coverage: 74.815% (-0.009%) from 74.824%
12375565970

push

github

web-flow
Avoid storing initial privileges for Babelfish objects created during initialization (#3136)

In Babelfish, Currently There are two patterns followed for initial privileges for system created objects:
1. Initial privileges are stored for the objects that are created during CREATE EXTENSION like system object, catalogs.
2. But for the objects that are created during `initialize_babelfish()` (which gets executed after creating extension) like dbo user, schema for system generated TSQL databases like master, msdb, tempdb, Initial privileges are not being recorded.

When there are any GRANT/REVOKE on objects which are created during `initialize_babelfish()` in any upgrade script, they are falsely being considered as internal/system-generated object and initial_privileges are being stored for them which can cause inconsistency between initial privileges of a newly spawned database server and upgraded database server.

To avoid this situation, we should not store initial privileges for GRANT/REVOKE execution during upgrade. For achieving this,

* Extension Changes:
This commit implements `pltsql_allow_storing_init_privs_hook` hook for checking whether to store initial privileges for given object or not.

  There are 3 category of handling storage of initial privileges:
   1. SAVE_INIT_PRIVS    : Check if it is objects created during CREATE extension and
                           store initial privs for them. system, information_schema_tsql
                           objects and pltsql language are the examples of it.
   
   2. DISCARD_INIT_PRIVS : If it is schema contained object within system created
                           TSQL schema like master, msdb or tempdb OR user created schema,
                           Do not store initial privileges for them.
   
   3. ERROR_INIT_PRIVS   : The default case when above 2 conditions doesn't match then error
                           out. To avoid error please classify it between above 2 c... (continued)

26 of 42 new or added lines in 1 file covered. (61.9%)

1 existing line in 1 file now uncovered.

46466 of 62108 relevant lines covered (74.81%)

167001.0 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
16
83.91
-0.39% contrib/babelfishpg_tsql/src/hooks.c

Uncovered Existing Lines

Lines Coverage ∆ File
1
83.91
-0.39% contrib/babelfishpg_tsql/src/hooks.c
Jobs
ID Job ID Ran Files Coverage
1 12375565970.1 17 Dec 2024 03:31PM UTC 115
74.81
GitHub Action Run
Source Files on build 12375565970
  • Tree
  • List 115
  • Changed 45
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #12375565970
  • 0b085d32 on github
  • Prev Build on BABEL_5_X_DEV (#12367805105)
  • Next Build on BABEL_5_X_DEV (#12381310412)
  • 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