Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conn: Implement driver.Validator, SessionResetter for cancelation #1079

Merged
merged 3 commits into from
Apr 14, 2023
Merged

conn: Implement driver.Validator, SessionResetter for cancelation #1079

merged 3 commits into from
Apr 14, 2023

Commits on Apr 15, 2022

  1. conn: Implement driver.Validator, SessionResetter for cancelation

    Commit 8446d16 released in 1.10.4 changed how some cancelled query
    errors were returned. This has caused a lib/pq application I work on
    to start returning "driver: bad connection". This is because we were
    cancelling a query, after looking at some of the rows. This causes a
    "bad" connection to be returned to the connection pool.
    
    To prevent this, implement the driver.Validator and
    driver.SessionResetter interfaces. The database/sql/driver package
    recommends implementing them:
    
    "All Conn implementations should implement the following interfaces:
    Pinger, SessionResetter, and Validator"
    
    Add two tests for this behaviour. One of these tests passed with
    1.10.3 but fails with newer versions. The other never passed, but
    does after this change.
    evanj committed Apr 15, 2022
    Configuration menu
    Copy the full SHA
    b073535 View commit details
    Browse the repository at this point in the history

Commits on Jan 29, 2023

  1. Configuration menu
    Copy the full SHA
    fb536a3 View commit details
    Browse the repository at this point in the history
  2. remove stray debugging code

    evanj committed Jan 29, 2023
    Configuration menu
    Copy the full SHA
    92adcb4 View commit details
    Browse the repository at this point in the history