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

babelfish-for-postgresql / babelfish_extensions / 8448497687
74%
BABEL_5_X_DEV: 77%

Build:
Build:
LAST BUILD BRANCH: jira-babel-6207
DEFAULT BRANCH: BABEL_5_X_DEV
Ran 27 Mar 2024 08:44AM 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

27 Mar 2024 08:06AM UTC coverage: 72.948% (-0.001%) from 72.949%
8448497687

push

github

web-flow
Send env change token in tds when error abort transaction block (#2401) (#2444)

In drivers which manage transaction automatically for the user, it is necessary to send the ENVCHANGE token on error which aborts a user transaction block. Other wise the driver will not be aware of this TRANSACTION ABORT.
For example consider this pyodbc case: (autocommit disabled, which also the default value in pyodbc)

cursor = cnxn.cursor()
cursor.execute("insert into t values (1)")
cursor.execute("insert into t values (2)")
try:
    cursor.execute("insert into t values ('aaaa')")
except:
    print("Let execution continue")
cursor.execute("insert into t values (3)")
cursor.execute("insert into t values (4)")
cnxn.rollback()
This currently gets executed as

BEGIN TRAN -- driver managed
INSERT INTO t VALUES (1)
INSERT INTO t VALUES (2)
INSERT INTO t VALUES ('aaaa') -- We hit an error here -- txn block aborted
INSERT INTO t VALUES (3)  -- No active transaction block -- auto commit behaviour
INSERT INTO t VALUES (4)  -- No active transaction block -- auto commit behaviour
ROLLBACK -- No transaction block active, we will get error
table 't' will contain values 3,4. Ideally this should have been empty since we are not committing any txn.
If we had notified driver about the transaction rollback on error, the execution would look like

BEGIN TRAN -- driver managed
INSERT INTO t VALUES (1)
INSERT INTO t VALUES (2)
INSERT INTO t VALUES ('aaaa') -- We hit an error here -- txn block aborted & driver notified
BEGIN TRAN -- since we notified the driver about the rollback
INSERT INTO t VALUES (3)  -- Active txn block, not yet committed
INSERT INTO t VALUES (4)  -- Active txn block, not yet committed
ROLLBACK -- txn block aborted
table 't' empty

Issues Resolved
[BABEL-4797]

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

7 of 7 new or added lines in 2 files covered. (100.0%)

2 existing lines in 1 file now uncovered.

41194 of 56470 relevant lines covered (72.95%)

62984.58 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
2
74.37
-0.63% contrib/babelfishpg_tds/src/backend/tds/tdscomm.c
Jobs
ID Job ID Ran Files Coverage
1 8448497687.1 27 Mar 2024 08:44AM UTC 114
72.95
GitHub Action Run
Source Files on build 8448497687
  • Tree
  • List 114
  • Changed 63
  • Source Changed 2
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #8448497687
  • 22d1825b on github
  • Prev Build on BABEL_3_X_DEV (#8424090708)
  • Next Build on BABEL_3_X_DEV (#8454281449)
  • 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