Skip to content

Major dependency upgrade to PyMySQL v1.2.3 - #2274

Merged
rolandwalker merged 1 commit into
mainfrom
RW/upgrade-pymysql-v1-2-3
Sep 26, 2026
Merged

rolandwalker merged 1 commit into
mainfrom
RW/upgrade-pymysql-v1-2-3

Conversation

@rolandwalker

Copy link
Copy Markdown
Contributor

Description

PyMySQL v1.2.0 was a breaking update which was avoided for some time.

The defaults for ping() have changed such that reconnect is False, and reconnect=True is also deprecated with a user-visible warning.

The defaults for SSL support on connect() have also changed: SSL mode is the default, and ssl_disabled must be set if SSL is not wanted.

Changes

  • Remove all reconnect parameters to ping().
  • Remove reconnect=True pass for mycli's reconnect(), which may never have been useful anyway.
  • Add support for the ssl_disabled kwarg to PyMySQL's connect().
  • Add a retry for PyMySQL's connect() on SSL failure with ssl_mode of auto.
  • Import ssl as ssllib in sqlexecute.py, since there is also a variable with the name ssl.

Each value of --ssl-mode on the client has been tested using a MySQL server both with and without SSL support. For the second case, a MySQL 8 server was run with --tls-version=''. On the client, the ability to connect under each combination was checked, along with consulting the output of /status.

The behavior of the /connect command in various situations is more difficult to verify, but since we only removed the second of three passes to the reconnect behavior, we can be reasonably confident that the overall behavior is still good.

Checklist

  • I added this contribution to the changelog.md file.
  • I added my name to the AUTHORS file (or it's already there).
  • To lint and format the code, I ran
    uv run ruff check && uv run ruff format && uv run mypy --install-types .

PyMySQL v1.2.0 was a breaking update which was avoided for some time.

The defaults for ping() have changed such that reconnect is False, and
reconnect=True is also deprecated with a user-visible warning.

The defaults for SSL support on connect() have also changed: SSL mode
is the default, and ssl_disabled must be set if SSL is not wanted.

Changes
 * remove all reconnect parameters to ping()
 * remove reconnect=True pass for mycli's reconnect(), which may never
   have been useful anyway
 * add support for the ssl_disabled kwarg to PyMySQL's connect()
 * add a retry for PyMySQL's connect() on SSL failure with ssl_mode of
   "auto"
 * import "ssl" as "ssllib" in sqlexecute.py, since there is also a
   variable with the name "ssl"

Each value of --ssl-mode on the client has been tested using a MySQL
server both with and without SSL support.  For the second case, a MySQL
8 server was run with --tls-version=''. On the client, the ability to
connect under each combination was checked, along with consulting the
output of /status.

The behavior of the /connect command in various situations is more
difficult to verify, but since we only removed the second of three
passes to the reconnect behavior, we can be reasonably confident that
the overall behavior is still good.
@rolandwalker rolandwalker self-assigned this Sep 26, 2026
@rolandwalker
rolandwalker merged commit ecb0891 into main Sep 26, 2026
12 checks passed
@rolandwalker
rolandwalker deleted the RW/upgrade-pymysql-v1-2-3 branch September 26, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant