Skip to content

sqlite UPDATE ... RETURNING fails with "cannot commit transaction - SQL statements in progress" #147

@ravi-sankarp

Description

@ravi-sankarp

When executing an UPDATE statement with a RETURNING clause in sqlit against SQLite, the following error is produced:

cannot commit transaction - SQL statements in progress

Minimal reproduction:

UPDATE jobs
SET status = status
WHERE id = 1
RETURNING id;

No explicit BEGIN/COMMIT is issued.

Expected behavior:
The statement should execute successfully and return the requested row(s).

Observed behavior:
sqlit reports:
cannot commit transaction - SQL statements in progress

Background:

SQLite requires that all prepared statements be fully stepped and finalized before a transaction can commit. This error suggests that sqlit may be implicitly wrapping statements in a transaction and attempting to commit before the RETURNING result set has been fully consumed or finalized.

Image

Question:

Does sqlit fully step through and finalize statements that produce result sets (such as UPDATE ... RETURNING) before committing implicit transactions?

If not, this may explain the observed error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions