Skip to content

fix: MySQL failure path ignores QueryError.transaction #942

Closed

Description

@EVWorth

#917 made the backend report transaction on a failed MySQL run. Until #941, CommandError in src/lib/tauri-api.ts dropped that field, so resultStore still infers the state after a failure from completedResults or from the statements that ran. #941 adds the field to CommandError but leaves MySQL alone.

The inference can be wrong when the failing statement itself changes transaction state, such as an implicit commit by DDL or a failed COMMIT, or when the session was already in a transaction before the run.

Fix

On the failure path, use CommandError.transaction when it is present, and keep the inference only as a fallback. Add a test: run BEGIN in one run, then a failing statement in the next; the TX badge must stay. Then run a failing DDL, which commits implicitly; the badge must clear.

Related

A tab with no connectionId (opened with "+") runs on the selected connection. If that connection is a SQLite file, a BEGIN there sets the file's flag, but the tab shows no badge because it isn't bound to the file. Binding such a tab to its connection on its first run would fix both.

Activity

  1. added
    bug
    on Oct 31, 2026
  2. added a commit that references this issue on Oct 31, 2026
    0d1ba8c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions