Skip to content

fix(mysql): COMMIT/ROLLBACK outside a transaction are OK; TRUNCATE; parenthesized UNION members - #60

Merged
luthermonson merged 2 commits into
mainfrom
fix/truncate-rollback-union
Oct 27, 2026
Merged

luthermonson merged 2 commits into
mainfrom
fix/truncate-rollback-union

Conversation

@luthermonson

Copy link
Copy Markdown
Contributor

Three more gaps from the Sendy 7.1.6 statement sweep (MySQL 8.4 vs litewire). Each one makes a statement that MySQL accepts fail on litewire:

  • mysqli_rollback() / COMMIT outside a transaction returned an error (no transaction is active). MySQL answers OK, and apps call rollback on their error paths. The session now absorbs exactly that one case.
  • TRUNCATE [TABLE] t now runs as DELETE FROM t. As in MySQL, ids restart at 1 on an emptied rowid table. Affected rows differ: MySQL reports 0, litewire reports the deleted count.
  • (SELECT ...) UNION (SELECT ...): SQLite rejects parenthesized compound members. Members without their own ORDER BY/LIMIT now lose the parentheses.

Unit tests are added, and tests/mysql_migration_forms.rs (rusqlite + Turso) now covers all three.

…arenthesized UNION members

From the Sendy statement sweep: mysqli_rollback() after a failed statement
errored (SQLite: no transaction is active) where MySQL answers OK;
TRUNCATE TABLE t did not exist (-> DELETE FROM t, ids restart as in
MySQL); (SELECT ...) UNION (SELECT ...) members lose their parentheses,
which SQLite rejects.
@luthermonson
luthermonson force-pushed the fix/truncate-rollback-union branch from f1d50fd to c4f5d80 Compare October 27, 2026 22:40
@luthermonson
luthermonson merged commit 98378da into main Oct 27, 2026
5 checks passed
@luthermonson
luthermonson deleted the fix/truncate-rollback-union branch October 27, 2026 22:47
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.

1 participant