Skip to content

Rollback Fails in SQLite on gLinux When DDL Is Mistakenly Passed as DQL without setting autocommit=False #187

@jahnavi2k

Description

@jahnavi2k

On gLinux with SQLite, if autocommit is not explicitly set to False, rollback does not work as expected when a DDL query is accidentally passed in place of a DQL query—even if rollback=True is set in the code (source).
This was discussed in PR #150.


Steps to Reproduce

  1. Pass a DDL query (e.g., ALTER TABLE) where a DQL query is expected.
    Example:

    Image
  2. After execution, the change persists—indicating rollback did not occur

    Image

    As shown above, the column remains renamed to post_content instead of reverting back to the original name: content.


Behavior with autocommit=False

If we explicitly set autocommit=False, the rollback does occur as expected.
Reference:
sqlite.py#L36


Why It Was Removed

However, we had to remove the autocommit=False line because it results in errors when running in Colab:

Image

Notes

  • This issue only affects DDL passed as DQL
  • DML passed as DQL does not exhibit this rollback issue

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions