Skip to content

Commit 6528137

Browse files
authored
Merge pull request #1304 from sodabrew/mysql-5.6.36-ssl
2 parents ad56ca4 + e9decbe commit 6528137

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

ext/mysql2/client.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ struct nogvl_select_db_args {
121121
static VALUE rb_set_ssl_mode_option(VALUE self, VALUE setting) {
122122
unsigned long version = mysql_get_client_version();
123123

124-
if (version < 50703) {
125-
rb_warn( "Your mysql client library does not support setting ssl_mode; full support comes with 5.7.11." );
124+
if (version < 50630 || (version >= 50700 && version < 50703)) {
125+
rb_warn( "Your mysql client library does not support setting ssl_mode; full support comes with 5.6.36+, 5.7.11+, 8.0+" );
126126
return Qnil;
127127
}
128128
#if defined(HAVE_CONST_MYSQL_OPT_SSL_VERIFY_SERVER_CERT) || defined(HAVE_CONST_MYSQL_OPT_SSL_ENFORCE)
@@ -1723,7 +1723,7 @@ void init_mysql2_client() {
17231723
rb_const_set(cMysql2Client, rb_intern("SESSION_TRACK_TRANSACTION_STATE"), INT2NUM(SESSION_TRACK_TRANSACTION_STATE));
17241724
#endif
17251725

1726-
#if defined(FULL_SSL_MODE_SUPPORT) // MySQL 5.7.11 and above
1726+
#if defined(FULL_SSL_MODE_SUPPORT) // MySQL 5.6.36 and MySQL 5.7.11 and above
17271727
rb_const_set(cMysql2Client, rb_intern("SSL_MODE_DISABLED"), INT2NUM(SSL_MODE_DISABLED));
17281728
rb_const_set(cMysql2Client, rb_intern("SSL_MODE_PREFERRED"), INT2NUM(SSL_MODE_PREFERRED));
17291729
rb_const_set(cMysql2Client, rb_intern("SSL_MODE_REQUIRED"), INT2NUM(SSL_MODE_REQUIRED));

ext/mysql2/result.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ static size_t rb_mysql_result_memsize(const void * wrapper) {
143143
return memsize;
144144
}
145145

146+
#ifdef HAVE_RB_GC_MARK_MOVABLE
146147
static void rb_mysql_result_compact(void * wrapper) {
147148
mysql2_result_wrapper * w = wrapper;
148149
if (w) {
@@ -153,6 +154,7 @@ static void rb_mysql_result_compact(void * wrapper) {
153154
rb_mysql2_gc_location(w->statement);
154155
}
155156
}
157+
#endif
156158

157159
static const rb_data_type_t rb_mysql_result_type = {
158160
"rb_mysql_result",

ext/mysql2/statement.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@ static size_t rb_mysql_stmt_memsize(const void * ptr) {
3333
return sizeof(*stmt_wrapper);
3434
}
3535

36+
#ifdef HAVE_RB_GC_MARK_MOVABLE
3637
static void rb_mysql_stmt_compact(void * ptr) {
3738
mysql_stmt_wrapper *stmt_wrapper = ptr;
3839
if (!stmt_wrapper) return;
3940

4041
rb_mysql2_gc_location(stmt_wrapper->client);
4142
}
43+
#endif
4244

4345
static const rb_data_type_t rb_mysql_statement_type = {
4446
"rb_mysql_statement",

0 commit comments

Comments
 (0)