Skip to content

[FIXED in 4.4.0] Don't retry a cached-plan error inside an aborted transaction #28

Closed

Description

@okomarov

When a prepared statement fails with a cached-plan error (0A000 "cached plan must not change result type", or 26000 after DEALLOCATE) inside a transaction, the driver retries it. The retry can never succeed: any error inside a transaction block aborts it, so the retried statement fails with 25P02 and the original plan error is lost.

After #21, sql.begin() in porsager#1234's scenario rolls back and frees the connection, but still rejects with 25P02. The reporter's ideal outcome was the 0A000.

Fix: skip the retry when ReadyForQuery reports transaction status E (failed transaction block) and reject with the original error. Test with the porsager#1234 reproduction asserting 0A000.

Activity

  1. added a commit that references this issue on Oct 11, 2026
  2. moved this to Shipped in Roadmapon Oct 15, 2026
  3. added
    area: transactions
    bug
    on Oct 16, 2026
  4. changed the title [-]Don't retry a cached-plan error inside an aborted transaction[/-] [+][FIXED in 4.4.0] Don't retry a cached-plan error inside an aborted transaction[/+] on Oct 17, 2026
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: transactionsbug

    Type

    No type

    Projects

    • Status
      Shipped

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions