Skip to content

Commit ee1882e

Browse files
committed
Replace deprecated MySQL APIs
1 parent e2a908b commit ee1882e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/MySQLdb/_mysql.c

+8-3
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,11 @@ _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
}
529533
if (ssl_mode) {
530534
#ifdef HAVE_ENUM_MYSQL_OPT_SSL_MODE
@@ -1789,10 +1793,11 @@ _mysql_ConnectionObject_kill(
17891793
{
17901794
unsigned long pid;
17911795
int r;
1796+
char query[50];
17921797
if (!PyArg_ParseTuple(args, "k:kill", &pid)) return NULL;
17931798
check_connection(self);
17941799
Py_BEGIN_ALLOW_THREADS
1795-
r = mysql_kill(&(self->connection), pid);
1800+
r = mysql_query(&(self->connection), snprintf(query, 50, "KILL %d", pid));
17961801
Py_END_ALLOW_THREADS
17971802
if (r) return _mysql_Exception(self);
17981803
Py_RETURN_NONE;
@@ -2008,7 +2013,7 @@ _mysql_ConnectionObject_shutdown(
20082013
int r;
20092014
check_connection(self);
20102015
Py_BEGIN_ALLOW_THREADS
2011-
r = mysql_shutdown(&(self->connection), SHUTDOWN_DEFAULT);
2016+
r = mysql_query(&(self->connection), "SHUTDOWN");
20122017
Py_END_ALLOW_THREADS
20132018
if (r) return _mysql_Exception(self);
20142019
Py_RETURN_NONE;

0 commit comments

Comments
 (0)