1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
Description: [PATCH] Fix compile error with MariaDB 10.2.
Don't touch MYSQL.reconnect directly.
Author: INADA Naoki <songofacandy@gmail.com>
Bug-Debian: https://bugs.debian.org/919393
Origin: Upstream, https://github.com/PyMySQL/mysqlclient-python/commit/d663649f851794dffa84010db6290e693d4baab8.patch
Date: Wed, 7 Jun 2017 14:46:54 +0900
Last-Update: 2019-01-15
diff --git a/_mysql.c b/_mysql.c
index c3ebc16..8295f6c 100644
--- a/_mysql.c
+++ b/_mysql.c
@@ -1908,7 +1908,10 @@ _mysql_ConnectionObject_ping(
int r, reconnect = -1;
if (!PyArg_ParseTuple(args, "|I", &reconnect)) return NULL;
check_connection(self);
- if ( reconnect != -1 ) self->connection.reconnect = reconnect;
+ if (reconnect != -1) {
+ my_bool recon = reconnect;
+ mysql_options(&self->connection, MYSQL_OPT_RECONNECT, &recon);
+ }
Py_BEGIN_ALLOW_THREADS
r = mysql_ping(&(self->connection));
Py_END_ALLOW_THREADS
|