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

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

Build:
Build:
LAST BUILD BRANCH: datetime2fromparts_bugfix
DEFAULT BRANCH: BABEL_5_X_DEV
Ran 19 Nov 2024 08:43AM 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

19 Nov 2024 08:08AM UTC coverage: 74.744% (+0.02%) from 74.723%
11908748001

push

github

web-flow
Make local variable to evaluate dynamically (only if it appears on TargetList) (#3011)

Currently, declared local variables are assumed to be static by analyser and hence it is replaced with const node by
optimiser. Currently, the parameter value will be supplied through pltsql_param_fetch(..) which is setup during
pltsql_estate_setup as part of ParamListInfo setup. This hook is purely used during planning phase and is not used
during query execution.

If parameter value is required during execution then values will be read from estate->ndatums through
pltsql_param_eval_var callback for EEOP_PARAM_CALLBACK step. This estate->ndatums setup during
pltsql_estate_setup and values are copied through copy_pltsql_datums(…). And currently, any assignments to declare
variables are implemented using "select target" which will be executed at the end of executor. Hence, any use of
variables will read original (value copied during pltsql_estate_setup(...)) and it would not reflect any dynamic change in
the value of any variable.

In order to make this behaviour dynamic, this commit introduces internal function sys.pltsql_assign_var(dno, expr).
Argument dno is item number of declared variable and expr could be anything whose value will be assigned to declared
variable pointed by dno during execution. We will use this function to rewrite any variables assignment operation during
ANTLR parsing as stated in following example,

select @a = expr

Will be written to

select @a = sys.pltsql_assign_var(dno, expr)

Internally, sys.pltsql_assign_var invokes exec_assign_value(…) to assign appropriate value directly to variable by
updating estate->ndatums array and hence any subsequent read will read latest value.

Engine PR: babelfish-for-postgresql/postgresql_modified_for_babelfish#469
Task: BABEL-5325
Signed-off-by: Dipesh Dhameliya <dddhamel@amazon.com>

116 of 119 new or added lines in 4 files covered. (97.48%)

14 existing lines in 2 files now uncovered.

45720 of 61169 relevant lines covered (74.74%)

162746.61 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
3
90.3
0.01% contrib/babelfishpg_tsql/src/tsqlIface.cpp

Uncovered Existing Lines

Lines Coverage ∆ File
4
90.3
0.01% contrib/babelfishpg_tsql/src/tsqlIface.cpp
10
83.51
-0.44% contrib/babelfishpg_tsql/src/hooks.c
Jobs
ID Job ID Ran Files Coverage
1 11908748001.1 19 Nov 2024 08:43AM UTC 115
74.74
GitHub Action Run
Source Files on build 11908748001
  • Tree
  • List 115
  • Changed 78
  • Source Changed 5
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #11908748001
  • 6be12f13 on github
  • Prev Build on BABEL_4_X_DEV (#11886904756)
  • Next Build on BABEL_4_X_DEV (#11912606117)
  • 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