8000 use KILL instead of COM_KILL for MySQL 8.4 support · PyMySQL/PyMySQL@40303c8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 40303c8

Browse files
committed
use KILL instead of COM_KILL for MySQL 8.4 support
1 parent 046d36c commit 40303c8

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.github/workflows/test.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ jobs:
4444
py: "3.10"
4545
mysql_auth: true
4646

47+
- db: "mysql:8.4"
48+
py: "3.13"
49+
mysql_auth: true
50+
4751
services:
4852
mysql:
4953
image: "${{ matrix.db }}"

pymysql/connections.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -576,9 +576,9 @@ def affected_rows(self):
576576
return self._affected_rows
577577

578578
def kill(self, thread_id):
579-
arg = struct.pack("<I", thread_id)
580-
self._execute_command(COMMAND.COM_PROCESS_KILL, arg)
581-
return self._read_ok_packet()
579+
if not isinstance(thread_id, int):
580+
raise TypeError("thread_id must be an integer")
581+
self.query(f"KILL {thread_id:d}")
582582

583583
def ping(self, reconnect=True):
584584
"""

0 commit comments

Comments
 (0)
0