Skip to content

Commit 53e19a7

Browse files
author
Jun Yamasaki
committed
Fix to enable the ssl_mode setting only for MySQL versions where enum MYSQL_OPT_SSL_MODE is defined
1 parent 35b74ce commit 53e19a7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

MySQLdb/_mysql.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,9 +479,15 @@ _mysql_ConnectionObject_Initialize(
479479
if (local_infile != -1)
480480
mysql_options(&(self->connection), MYSQL_OPT_LOCAL_INFILE, (char *) &local_infile);
481481

482+
#if ((MYSQL_VERSION_ID >= 50555 && MYSQL_VERSION_ID <= 50599) || \
483+
(MYSQL_VERSION_ID >= 50636 && MYSQL_VERSION_ID <= 50699) || \
484+
(MYSQL_VERSION_ID >= 50711 && MYSQL_VERSION_ID <= 50799) || \
485+
(MYSQL_VERSION_ID >= 80000)) && \
486+
!defined(MARIADB_BASE_VERSION) && !defined(MARIADB_VERSION_ID)
482487
if (ssl_mode) {
483488
mysql_options(&(self->connection), MYSQL_OPT_SSL_MODE, &ssl_mode);
484489
}
490+
#endif
485491
if (ssl) {
486492
mysql_ssl_set(&(self->connection), key, cert, ca, capath, cipher);
487493
}

0 commit comments

Comments
 (0)