Skip to content

Commit 720b804

Browse files
authored
Support MySQL 8.3 (#690)
Fix #688
1 parent 9e3b00f commit 720b804

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Diff for: src/MySQLdb/_mysql.c

+9-3
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,13 @@ _mysql_ConnectionObject_Initialize(
524524
mysql_options(&(self->connection), MYSQL_OPT_LOCAL_INFILE, (char *) &local_infile);
525525

526526
if (ssl) {
527-
mysql_ssl_set(&(self->connection), key, cert, ca, capath, cipher);
527+
mysql_options(&(self->connection), MYSQL_OPT_SSL_KEY, key);
528+
mysql_options(&(self->connection), MYSQL_OPT_SSL_CERT, cert);
529+
mysql_options(&(self->connection), MYSQL_OPT_SSL_CA, ca);
530+
mysql_options(&(self->connection), MYSQL_OPT_SSL_CAPATH, capath);
531+
mysql_options(&(self->connection), MYSQL_OPT_SSL_CIPHER, cipher);
528532
}
533+
529534
if (ssl_mode) {
530535
#ifdef HAVE_ENUM_MYSQL_OPT_SSL_MODE
531536
mysql_options(&(self->connection), MYSQL_OPT_SSL_MODE, &ssl_mode_num);
@@ -1789,10 +1794,11 @@ _mysql_ConnectionObject_kill(
17891794
{
17901795
unsigned long pid;
17911796
int r;
1797+
char query[50];
17921798
if (!PyArg_ParseTuple(args, "k:kill", &pid)) return NULL;
17931799
check_connection(self);
17941800
Py_BEGIN_ALLOW_THREADS
1795-
r = mysql_kill(&(self->connection), pid);
1801+
r = mysql_query(&(self->connection), snprintf(query, 50, "KILL %d", pid));
17961802
Py_END_ALLOW_THREADS
17971803
if (r) return _mysql_Exception(self);
17981804
Py_RETURN_NONE;
@@ -2008,7 +2014,7 @@ _mysql_ConnectionObject_shutdown(
20082014
int r;
20092015
check_connection(self);
20102016
Py_BEGIN_ALLOW_THREADS
2011-
r = mysql_shutdown(&(self->connection), SHUTDOWN_DEFAULT);
2017+
r = mysql_query(&(self->connection), "SHUTDOWN");
20122018
Py_END_ALLOW_THREADS
20132019
if (r) return _mysql_Exception(self);
20142020
Py_RETURN_NONE;

0 commit comments

Comments
 (0)