Skip to content

{94886844} feat: add with_effects to db_commit#5715

Merged
emelialei88 merged 1 commit intobloomberg:mainfrom
emelialei88:feat/db_commit
Feb 17, 2026
Merged

{94886844} feat: add with_effects to db_commit#5715
emelialei88 merged 1 commit intobloomberg:mainfrom
emelialei88:feat/db_commit

Conversation

@emelialei88
Copy link
Contributor

Extends the Lua stored procedure db:commit() API to optionally return transaction effects (row-change counts) after a successful commit. db:commit() now accepts an optional Lua table parameter with a single boolean field with_effects. When called as rc, effects = db:commit({ with_effects = true }), it returns the usual result code plus an effects Lua table matching the struct cdb2_effects_type. Default behavior remains unchanged when the option is not provided.

($0=x'00112233445566778899001122334455667788990011223344556677889900112233445566778899')
(version='1')
(rows inserted=1)
Testing db:commit with with_effects
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a test which does all operations in a single transaction as well? Also test for num_selected, num_affected.

@mponomar
Copy link
Contributor

mponomar commented Feb 6, 2026

/runtests

Copy link

@roborivers roborivers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding style check: Success ✓.
Cbuild submission: Success ✓.
Regression testing: Success ✓.

The first 10 failing tests are:
truncatesc_offline_generated [core dumped]
insert_lots
sp_twofiles_generated
sp_queueodh_generated
sp_snapshot_generated
sp
consumer_non_atomic_default_consumer_generated
sc_transactional_rowlocks_generated
pmux_sqlite_file_generated
insert_lots_ssl_generated

@akshatsikarwar
Copy link
Contributor

Also need to update docs - https://bloomberg.github.io/comdb2/storedprocs.html#dbcommit (and then on Tutti as well)

@emelialei88 emelialei88 force-pushed the feat/db_commit branch 2 times, most recently from 8fa1442 to 81e7ab2 Compare February 11, 2026 17:12
Signed-off-by: Emelia Lei <wlei29@bloomberg.net>
Copy link

@roborivers roborivers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cbuild submission: Success ✓.
Regression testing: Success ✓.

The first 10 failing tests are:
sp_snapshot_generated
consumer_non_atomic_default_consumer_generated
sc_transactional_rowlocks_generated

Copy link

@roborivers roborivers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cbuild submission: Success ✓.
Regression testing: Success ✓.

The first 10 failing tests are:
sc_resume_logicalsc_generated
reco-ddlk-sql
consumer_non_atomic_default_consumer_generated

Copy link

@roborivers roborivers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cbuild submission: Success ✓.
Regression testing: 0/0 tests failed ⚠.

@emelialei88 emelialei88 merged commit 90474c8 into bloomberg:main Feb 17, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants