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

babelfish-for-postgresql / babelfish_extensions / 13546613638
77%

Build:
DEFAULT BRANCH: BABEL_5_X_DEV
Ran 26 Feb 2025 03:25PM UTC
Jobs 1
Files 115
Run time 71min
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

26 Feb 2025 02:48PM UTC coverage: 75.01% (-0.02%) from 75.03%
13546613638

push

github

web-flow
fix object resolution inside pltsql routines (#3394)

When an non fully qualified object is used inside a pltsql routine, it must get resolved to the logical database that contains the routine being executed. If the schema is also not specified then the object must be first looked inside the procedure's schema then the dbo schema of the database.

For DDL and EXEC statements the order of schemas is different
<default_schema_of_user>, <dbo_schema_of_database>, sys, pg_catalog

We achieve this behaviour by maintain two global static variables.

    current_db_search_path - search path for the current active logical database for the current login
    pltsql_search_path - search path of the inner most executing routine

Now based on the statement being executed, we will decided what the search path should be inside dispatch_stmt().
This is needed since search path is a transactional GUC and setting it once inside a procedure is not enough since any rollback or error could reset the search path to its previous value. Also attempts at making search path a scope based GUC failed since engine internally sets the search path for some cases and expects it work transactionally.

Some other changes included in this PR

    Merged set_session_properties function into set_cur_user_db_and_path. Just needed pass one more argument.
    "sp_" prefixed procedures called like db.dbo.sp_ & db..sp_ must also look into dbo schema of master database and sys schema for the procedure even though the db name and schema has been specified.
    We fix this by removing the db name and schema name at ANTLR parsing.
    Non pltsql "sp_" system procedure in master.dbo schema will not have tsql error handling. After the fix we did in 2, we can just remove this sp_ procedures in master.dbo schema. Since master.dbo.sp_* will anyway look into sys schema as well now.
    db_id() & db_name() were defined as immutable which is not correct, since db_id can change in the same session.
    Use... (continued)

179 of 184 new or added lines in 12 files covered. (97.28%)

2 existing lines in 2 files now uncovered.

47134 of 62837 relevant lines covered (75.01%)

188139.78 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
83.63
-0.0% contrib/babelfishpg_tsql/runtime/functions.c
1
83.96
-0.09% contrib/babelfishpg_tsql/src/hooks.c
1
84.22
0.59% contrib/babelfishpg_tsql/src/iterative_exec.c
1
43.35
-1.48% contrib/babelfishpg_tsql/src/pl_exec.c
1
96.98
-0.45% contrib/babelfishpg_tsql/src/session.c

Uncovered Existing Lines

Lines Coverage ∆ File
1
83.96
-0.09% contrib/babelfishpg_tsql/src/hooks.c
1
82.21
-0.08% contrib/babelfishpg_tsql/src/pl_exec-2.c
Jobs
ID Job ID Ran Files Coverage
1 13546613638.1 26 Feb 2025 03:25PM UTC 115
75.01
GitHub Action Run
Source Files on build 13546613638
  • Tree
  • List 115
  • Changed 83
  • Source Changed 13
  • Coverage Changed 13
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #13546613638
  • 1ebca2bc on github
  • Prev Build on BABEL_5_X_DEV (#13537146171)
  • Next Build on BABEL_5_X_DEV (#13560355751)
  • 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