Skip to content

use KILL instead of COM_KILL for MySQL 8.4 support #1197

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

Merged
merged 3 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,29 @@ jobs:
matrix:
include:
- db: "mariadb:10.4"
py: "3.8"
py: "3.13"

- db: "mariadb:10.5"
py: "3.8"
py: "3.11"

- db: "mariadb:10.6"
py: "3.11"
py: "3.10"

- db: "mariadb:10.6"
py: "3.13"
py: "3.9"

- db: "mariadb:lts"
py: "3.9"
py: "3.8"

- db: "mysql:5.7"
py: "pypy-3.10"

- db: "mysql:8.0"
py: "3.8"
py: "3.13"
mysql_auth: true

- db: "mysql:8.0"
py: "3.10"
- db: "mysql:8.4"
py: "3.8"
mysql_auth: true

services:
Expand Down
6 changes: 3 additions & 3 deletions pymysql/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,9 +576,9 @@
return self._affected_rows

def kill(self, thread_id):
arg = struct.pack("<I", thread_id)
self._execute_command(COMMAND.COM_PROCESS_KILL, arg)
return self._read_ok_packet()
if not isinstance(thread_id, int):
raise TypeError("thread_id must be an integer")

Check warning on line 580 in pymysql/connections.py

View check run for this annotation

Codecov / codecov/patch

pymysql/connections.py#L580

Added line #L580 was not covered by tests
self.query(f"KILL {thread_id:d}")

def ping(self, reconnect=True):
"""
Expand Down
1 change: 1 addition & 0 deletions pymysql/tests/test_charset.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def test_utf8():
assert uppercase_utf8 == lowercase_utf8
assert mixedcase_utf8 == lowercase_utf8


def test_case_sensitivity():
lowercase_latin1 = pymysql.charset.charset_by_name("latin1")
assert lowercase_latin1 is not None
Expand Down
Loading