Skip to content

Commit bcad0e0

Browse files
committed
Update comments around MariaDB versions
Also removed the check for a potential MariaDB 11.x since there's no indication that this behavior will change in MariaDB.
1 parent 04015ba commit bcad0e0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ext/mysql2/client.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static ID intern_brackets, intern_merge, intern_merge_bang, intern_new_with_args
6969
#endif
7070

7171
/*
72-
* compatibility with mysql-connector-c 6.1.x, and with MySQL 5.7.3 - 5.7.10.
72+
* compatibility with mysql-connector-c 6.1.x, MySQL 5.7.3 - 5.7.10 & with MariaDB 10.x and later.
7373
*/
7474
#ifdef HAVE_CONST_MYSQL_OPT_SSL_VERIFY_SERVER_CERT
7575
#define SSL_MODE_VERIFY_IDENTITY 5
@@ -128,8 +128,8 @@ static VALUE rb_set_ssl_mode_option(VALUE self, VALUE setting) {
128128
#if defined(HAVE_CONST_MYSQL_OPT_SSL_VERIFY_SERVER_CERT) || defined(HAVE_CONST_MYSQL_OPT_SSL_ENFORCE)
129129
GET_CLIENT(self);
130130
int val = NUM2INT( setting );
131-
// Either MySQL 5.7.3 - 5.7.10, or Connector/C 6.1.3 - 6.1.x, or MariaDB 10.x
132-
if ((version >= 50703 && version < 50711) || (version >= 60103 && version < 60200) || (version >= 100000 && version < 110000)) {
131+
// Either MySQL 5.7.3 - 5.7.10, or Connector/C 6.1.3 - 6.1.x, or MariaDB 10.x and later
132+
if ((version >= 50703 && version < 50711) || (version >= 60103 && version < 60200) || version >= 100000) {
133133
#ifdef HAVE_CONST_MYSQL_OPT_SSL_VERIFY_SERVER_CERT
134134
if (val == SSL_MODE_VERIFY_IDENTITY) {
135135
my_bool b = 1;
@@ -1690,10 +1690,10 @@ void init_mysql2_client() {
16901690
rb_const_set(cMysql2Client, rb_intern("SSL_MODE_VERIFY_CA"), INT2NUM(SSL_MODE_VERIFY_CA));
16911691
rb_const_set(cMysql2Client, rb_intern("SSL_MODE_VERIFY_IDENTITY"), INT2NUM(SSL_MODE_VERIFY_IDENTITY));
16921692
#else
1693-
#ifdef HAVE_CONST_MYSQL_OPT_SSL_VERIFY_SERVER_CERT // MySQL 5.7.3 - 5.7.10
1693+
#ifdef HAVE_CONST_MYSQL_OPT_SSL_VERIFY_SERVER_CERT // MySQL 5.7.3 - 5.7.10 & MariaDB 10.x and later
16941694
rb_const_set(cMysql2Client, rb_intern("SSL_MODE_VERIFY_IDENTITY"), INT2NUM(SSL_MODE_VERIFY_IDENTITY));
16951695
#endif
1696-
#ifdef HAVE_CONST_MYSQL_OPT_SSL_ENFORCE // MySQL 5.7.3 - 5.7.10
1696+
#ifdef HAVE_CONST_MYSQL_OPT_SSL_ENFORCE // MySQL 5.7.3 - 5.7.10 & MariaDB 10.x and later
16971697
rb_const_set(cMysql2Client, rb_intern("SSL_MODE_DISABLED"), INT2NUM(SSL_MODE_DISABLED));
16981698
rb_const_set(cMysql2Client, rb_intern("SSL_MODE_REQUIRED"), INT2NUM(SSL_MODE_REQUIRED));
16991699
#endif

0 commit comments

Comments
 (0)