Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: PyMySQL/mysqlclient
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 79db3b4
Choose a base ref
...
head repository: PyMySQL/mysqlclient
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1bd91a2
Choose a head ref
  • 5 commits
  • 10 files changed
  • 2 contributors

Commits on Nov 14, 2026

  1. Restore isinstance checks for string and byte literals (#814)

    mysqlclient 2.3.1 changed `Connection.literal()` to dispatch on exact
    built-in types. As reported in
    #813 (comment),
    this makes a `class Foo(str, enum.Enum)` member serialize as `'Foo.BAR'`
    instead of its string value `'BAR'`.
    
    Restore `isinstance()` checks only for `str`, `bytes`, and `bytearray`,
    so their subclasses receive the corresponding string/byte handling.
    methane authored Nov 14, 2026
    Configuration menu
    Copy the full SHA
    8c8f499 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2d37f14 View commit details
    Browse the repository at this point in the history

Commits on Nov 18, 2026

  1. Free buffered results without acquiring the connection lock (#815)

    `mysql_store_result()` reads every row into client memory. When another
    Python thread drops the last reference to a buffered result, it can free
    that memory without taking the connection lock. This avoids the spurious
    `ProgrammingError` reported in #808 when the connection owner starts its
    next operation. Unbuffered results still take the lock because
    `mysql_free_result()` may read pending rows from the connection.
    methane authored Nov 18, 2026
    Configuration menu
    Copy the full SHA
    eef31ea View commit details
    Browse the repository at this point in the history
  2. Escape bytearray contents as bytes in string literals (#817)

    Passing `bytearray(b'ab')` as a query parameter currently sends the
    Python text `bytearray(b'ab')` to the server. Escape the underlying two
    bytes so the parameter behaves like `b'ab'`. This also applies to
    `bytearray` subclasses. On free-threaded builds, the copy is protected
    by the bytearray's critical section.
    
    The new low-level tests failed before the fix and passed with the
    rebuilt CPython 3.14 wheel (32 tests passed locally). The updated
    database test checks the returned value with `binary_prefix` enabled and
    disabled and is left to CI. Ruff and `git diff --check` passed.
    
    Related discussion in #816.
    
    <!-- This is an auto-generated comment: release notes by coderabbit.ai
    -->
    
    <!-- coderabbit-ai-generated:v1 -->
    
    ## Summary by CodeRabbit
    
    * **Bug Fixes**
    * `bytearray` values are now handled consistently with `bytes` when
    creating SQL literals, including values containing quotes, null bytes,
    or backslashes. Subclasses are processed from their byte contents rather
    than their string representation.
    * **Documentation**
    * Clarified how `string_literal` handles byte-like values versus other
    objects.
    
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->
    methane authored Nov 18, 2026
    Configuration menu
    Copy the full SHA
    41f49cf View commit details
    Browse the repository at this point in the history
  3. release v2.3.2 (#816)

    Prepare mysqlclient 2.3.2 with release notes dated 2026-11-18 for
    subclass literal conversion (#814), buffered-result deallocation (#815),
    and bytearray parameter escaping (#817), and update both version fields.
    methane authored Nov 18, 2026
    Configuration menu
    Copy the full SHA
    1bd91a2 View commit details
    Browse the repository at this point in the history
Loading