diff --git a/ext/mysql2/client.c b/ext/mysql2/client.c index 4f62e463..fbc73572 100644 --- a/ext/mysql2/client.c +++ b/ext/mysql2/client.c @@ -121,8 +121,8 @@ struct nogvl_select_db_args { static VALUE rb_set_ssl_mode_option(VALUE self, VALUE setting) { unsigned long version = mysql_get_client_version(); - if (version < 50703) { - rb_warn( "Your mysql client library does not support setting ssl_mode; full support comes with 5.7.11." ); + if (version < 50630 || (version >= 50700 && version < 50703)) { + rb_warn( "Your mysql client library does not support setting ssl_mode; full support comes with 5.6.36+, 5.7.11+, 8.0+" ); return Qnil; } #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() { rb_const_set(cMysql2Client, rb_intern("SESSION_TRACK_TRANSACTION_STATE"), INT2NUM(SESSION_TRACK_TRANSACTION_STATE)); #endif -#if defined(FULL_SSL_MODE_SUPPORT) // MySQL 5.7.11 and above +#if defined(FULL_SSL_MODE_SUPPORT) // MySQL 5.6.36 and MySQL 5.7.11 and above rb_const_set(cMysql2Client, rb_intern("SSL_MODE_DISABLED"), INT2NUM(SSL_MODE_DISABLED)); rb_const_set(cMysql2Client, rb_intern("SSL_MODE_PREFERRED"), INT2NUM(SSL_MODE_PREFERRED)); rb_const_set(cMysql2Client, rb_intern("SSL_MODE_REQUIRED"), INT2NUM(SSL_MODE_REQUIRED)); diff --git a/ext/mysql2/result.c b/ext/mysql2/result.c index 5cacd5ac..23ec611e 100644 --- a/ext/mysql2/result.c +++ b/ext/mysql2/result.c @@ -143,6 +143,7 @@ static size_t rb_mysql_result_memsize(const void * wrapper) { return memsize; } +#ifdef HAVE_RB_GC_MARK_MOVABLE static void rb_mysql_result_compact(void * wrapper) { mysql2_result_wrapper * w = wrapper; if (w) { @@ -153,6 +154,7 @@ static void rb_mysql_result_compact(void * wrapper) { rb_mysql2_gc_location(w->statement); } } +#endif static const rb_data_type_t rb_mysql_result_type = { "rb_mysql_result", diff --git a/ext/mysql2/statement.c b/ext/mysql2/statement.c index 2af1c486..5506526e 100644 --- a/ext/mysql2/statement.c +++ b/ext/mysql2/statement.c @@ -33,12 +33,14 @@ static size_t rb_mysql_stmt_memsize(const void * ptr) { return sizeof(*stmt_wrapper); } +#ifdef HAVE_RB_GC_MARK_MOVABLE static void rb_mysql_stmt_compact(void * ptr) { mysql_stmt_wrapper *stmt_wrapper = ptr; if (!stmt_wrapper) return; rb_mysql2_gc_location(stmt_wrapper->client); } +#endif static const rb_data_type_t rb_mysql_statement_type = { "rb_mysql_statement",