Skip to content

Commit 1bd91a2

Browse files
authored
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.
1 parent 41f49cf commit 1bd91a2

3 files changed

Lines changed: 73 additions & 35 deletions

File tree

‎AGENTS.md‎

Lines changed: 52 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,68 @@
1-
## Rule
1+
## Checks before committing
22

3-
Do `ruff format` and `ruff check` before commit.
3+
Run commands from the repository root. Format and lint the source before
4+
committing:
45

5-
## Running the MySQL test suite in this container
6+
```sh
7+
ruff format src/
8+
ruff check src/
9+
git diff --check
10+
```
611

7-
1. Install the server and test dependencies if they are not already available:
12+
## Running the mysqlclient test suite
813

9-
```sh
10-
apt-get update
11-
DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server
12-
python -m pip install --upgrade -r requirements-dev.txt
13-
```
14+
The CI configuration is in [.github/workflows/tests.yaml](.github/workflows/tests.yaml).
15+
The package is in `src/MySQLdb/` and the tests are in `tests/`.
16+
17+
1. Install a C compiler, Python development headers, `pkg-config`, and MySQL or
18+
MariaDB client development libraries, as described in [README.md](README.md).
19+
A running MySQL or MariaDB server is also required for database tests.
1420

15-
2. Keep MySQL running in a separate, long-lived terminal/session. The container
16-
does not run systemd, so start `mysqld` directly instead of using
17-
`systemctl`:
21+
2. In a Python virtual environment, install the package and test dependencies:
1822

1923
```sh
20-
install -d -o mysql -g mysql /run/mysqld
21-
rm -f /run/mysqld/mysqld.sock /run/mysqld/mysqld.sock.lock \
22-
/run/mysqld/mysqlx.sock /run/mysqld/mysqlx.sock.lock \
23-
/run/mysqld/mysqld.pid
24-
mysqld --user=mysql --local-infile=1 \
25-
--socket=/run/mysqld/mysqld.sock \
26-
--pid-file=/run/mysqld/mysqld.pid
24+
python -m pip install -v .
25+
python -m pip install -r requirements.txt
26+
python -m pip install "SQLAlchemy>=2,<3"
2727
```
2828

29-
3. In another terminal/session, wait for MySQL and initialize a fresh data
30-
directory. The SQL files create databases and users, so only run them when
31-
`test1` does not exist:
29+
SQLAlchemy is needed to run `tests/test_sqlalchemy.py`; those tests are
30+
skipped if it is not installed.
31+
32+
3. Start the database server using the service manager available in your
33+
environment. In containers without a service manager, run `mysqld` in a
34+
separate, long-lived terminal with an initialized data directory and writable
35+
socket and PID file locations.
36+
37+
Create a dedicated test database using an administrator connection, for example:
3238

3339
```sh
34-
until mysqladmin ping --silent; do sleep 1; done
35-
if ! mysql -NBe "SHOW DATABASES LIKE 'test1'" | rg -q '^test1$'; then
36-
mysql -uroot --comments < ci/docker-entrypoint-initdb.d/init.sql
37-
mysql -uroot --comments < ci/docker-entrypoint-initdb.d/mysql.sql
38-
mysql -uroot --comments < ci/docker-entrypoint-initdb.d/mariadb.sql
39-
fi
40-
cp ci/docker.json pymysql/tests/databases.json
40+
mysql -uroot -p -e "CREATE DATABASE IF NOT EXISTS mysqldb_test"
4141
```
4242

43-
4. Run the same test commands as CI:
43+
The test user needs to create, alter, and drop tables, run `SELECT`,
44+
`INSERT`, `UPDATE`, and `DELETE`, and create, execute, and drop stored
45+
procedures in that database.
46+
`tests/actions.cnf` uses `127.0.0.1:3306`, user `root`, password `root`, and
47+
database `mysqldb_test`. For different credentials, create a separate MySQL
48+
option file with a `[MySQLdb-tests]` group, using `tests/actions.cnf` as a
49+
template.
50+
51+
4. Run the same pytest command as CI:
4452

4553
```sh
46-
pytest -v --cov --cov-config .coveragerc pymysql
47-
pytest -v --cov-append --cov-config .coveragerc \
48-
--doctest-modules pymysql/converters.py
54+
TESTDB=actions.cnf pytest --cov=MySQLdb tests
4955
```
56+
57+
`TESTDB` selects a filename under `tests/` or an absolute path to an option
58+
file. Without it, `tests/default.cnf` is used. The tests create and drop
59+
tables, so use the dedicated test database.
60+
61+
CI also runs the Django test suite in a separate job. Refer to
62+
`.github/workflows/tests.yaml` for its dependencies, database setup, and
63+
`test_mysql_executemany_multi` settings.
64+
65+
## Releases
66+
67+
Follow [notes/release.md](notes/release.md) for version updates, release CI,
68+
tagging, and publication.

‎HISTORY.rst‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
======================
2+
What's new in 2.3.2
3+
======================
4+
5+
Release: 2026-11-18
6+
7+
* Restore the use of the base type's literal conversion for subclasses of
8+
``str``, ``bytes``, and ``bytearray``. This fixes a regression in 2.3.1 where string-valued
9+
``enum.Enum`` members were serialized using their enum names instead of their
10+
string values. (#814)
11+
12+
* Avoid a spurious ``ProgrammingError`` when another thread drops the last
13+
reference to a buffered result while the connection is in use. (#815)
14+
15+
* Escape the contents of ``bytearray`` query parameters the same way as
16+
``bytes``. Previously, passing ``bytearray(b'ab')`` sent the Python string
17+
representation to the server. This also applies to subclasses. (#817)
18+
19+
120
======================
221
What's new in 2.3.1
322
======================

‎src/MySQLdb/release.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
__author__ = "Inada Naoki <songofacandy@gmail.com>"
2-
__version__ = "2.3.1"
3-
version_info = (2, 3, 1, "final", 0)
2+
__version__ = "2.3.2"
3+
version_info = (2, 3, 2, "final", 0)

0 commit comments

Comments
 (0)