From 37262a07fae4722d1f62350e7741616b89def0ac Mon Sep 17 00:00:00 2001 From: Pavel Vasev Date: Sat, 27 Jun 2020 13:51:28 +0500 Subject: [PATCH 1/3] Update result.c Fix number of arguments --- ext/mysql2/result.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/mysql2/result.c b/ext/mysql2/result.c index 5b8a5b162..9054ed545 100644 --- a/ext/mysql2/result.c +++ b/ext/mysql2/result.c @@ -297,7 +297,7 @@ static VALUE rb_mysql_result_fetch_row(VALUE self, ID db_timezone, ID app_timezo break; } msec = msec_char_to_uint(msec_char, sizeof(msec_char)); - val = rb_funcall(rb_cTime, db_timezone, 6, opt_time_year, opt_time_month, opt_time_month, UINT2NUM(hour), UINT2NUM(min), UINT2NUM(sec), UINT2NUM(msec)); + val = rb_funcall(rb_cTime, db_timezone, 7, opt_time_year, opt_time_month, opt_time_month, UINT2NUM(hour), UINT2NUM(min), UINT2NUM(sec), UINT2NUM(msec)); if (!NIL_P(app_timezone)) { if (app_timezone == intern_local) { val = rb_funcall(val, intern_localtime, 0); From ef9aabeac6eb018ff3b25651d4dbbe3949620f1f Mon Sep 17 00:00:00 2001 From: Pavel Vasev Date: Sat, 27 Jun 2020 17:42:10 +0500 Subject: [PATCH 2/3] Update version.rb bump to version 0.2.25 --- lib/mysql2/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mysql2/version.rb b/lib/mysql2/version.rb index dff849ff2..7e5633d2a 100644 --- a/lib/mysql2/version.rb +++ b/lib/mysql2/version.rb @@ -1,3 +1,3 @@ module Mysql2 - VERSION = "0.2.24" + VERSION = "0.2.25" end From 3522107f6ac73805bda963d1415ba4581411a76e Mon Sep 17 00:00:00 2001 From: pavelvasev Date: Thu, 16 Jul 2020 10:39:50 +0000 Subject: [PATCH 3/3] activesupport 2.3 compatibility for 0.2.x branch --- lib/mysql2/error.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/mysql2/error.rb b/lib/mysql2/error.rb index 8e6ed5b94..c78a5cfbd 100644 --- a/lib/mysql2/error.rb +++ b/lib/mysql2/error.rb @@ -16,7 +16,7 @@ class Error < StandardError def initialize(msg, server_version=nil) self.server_version = server_version - super(clean_message(msg)) + super(mysql2_clean_message(msg)) end def sql_state=(state) @@ -52,7 +52,9 @@ def sql_state=(state) # Except for if we're on 1.8, where we'll do nothing ;) # # Returns a valid UTF-8 string in Ruby 1.9+, the original string on Ruby 1.8 - def clean_message(message) + + # the name `mysql2_clean_message` is used to avoid conflict with `clean_message` method in activesupport 2.3 + def mysql2_clean_message(message) return message if !message.respond_to?(:encoding) if @server_version && @server_version > 50500