Skip to content

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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