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

babelfish-for-postgresql / babelfish_extensions / 8434518778 / 1
76%
BABEL_5_X_DEV: 77%

Build:
Build:
LAST BUILD BRANCH: jira-babel-6207
DEFAULT BRANCH: BABEL_5_X_DEV
Ran 26 Mar 2024 11:10AM UTC
Files 114
Run time 7s
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 Mar 2024 10:32AM UTC coverage: 72.546% (+0.004%) from 72.542%
8434518778.1

push

github

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

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>

41116 of 56676 relevant lines covered (72.55%)

63013.74 hits per line

Source Files on job 8434518778.1
  • Tree
  • List 114
  • Changed 65
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 8434518778
  • cb3333a6 on github
  • Prev Job for on BABEL_4_X_DEV (#8397549046.1)
  • Next Job for on BABEL_4_X_DEV (#8443465826.1)
  • 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