Skip to content

[FIXED in 4.7.0] A statement that fails to serialize does not abort its transaction, so COMMIT succeeds without it #70

Closed

Description

@okomarov

A query that fails before it reaches the server (a value that can't be serialized, a query that fails to build) is rejected on its own, and the connection sends a bare Sync (#20, 4.3.0). The server never sees an error, so the transaction carries on: a pipelined commit on a reserved connection, or a sql.begin() callback that doesn't await the failing statement, commits the other statements without it. A server-side error in the same place rolls the transaction back.

Proposed upstream: porsager#1238 and porsager#1236 abort the transaction instead.

Decision needed: inside a transaction, a client-side failure should leave the transaction failed, so that COMMIT rolls back. Outside one, rejecting only the failing query stays.

Activity

  1. added
    bug
    area: transactions
    upstream
    on Oct 16, 2026
  2. moved this to Next in Roadmapon Oct 16, 2026
  3. added this to the 4.7.0 milestone on Oct 21, 2026
  4. added 6 commits that reference this issue on Oct 21, 2026
    c721532
    e9294f7
    3ca6d8f
    0f2d5d2
    df32999
    cd1f85c
  5. moved this from Next to Shipped in Roadmapon Oct 24, 2026
  6. changed the title [-]A statement that fails to serialize does not abort its transaction, so COMMIT succeeds without it[/-] [+][FIXED in 4.7.0] A statement that fails to serialize does not abort its transaction, so COMMIT succeeds without it[/+] on Oct 24, 2026
  7. okomarov commented on Oct 24, 2026

    @okomarov
    Author

    Shipped in 4.7.0. A query that fails before it is sent now fails the transaction it is in, so COMMIT rolls back. Covered by the reserved-connection pipeline tests in tests/index.js (an undefined value, too many parameters, and a value whose serializer throws after describe, with prepare on and off), the savepoint test, and the sql.begin test where the failing query runs after the callback returned. On upstream 3.4.9 these reproduce porsager#1236 and porsager#1238.

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

    area: transactionsbugupstream

    Type

    No type

    Projects

    • Status
      Shipped

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions