Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.2.x update for ruby 2.5 #1126

Open
wants to merge 3 commits into
base: 0.2.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/mysql2/result.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 4 additions & 2 deletions lib/mysql2/error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/mysql2/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Mysql2
VERSION = "0.2.24"
VERSION = "0.2.25"
end