Skip to content

Commit

Permalink
latest from 0.2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
brianmario committed Aug 17, 2011
2 parents e74645e + 4ee579e commit 38005af
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## 0.3.7 (August 16th, 2011)
* ensure symbolized column names support encodings in 1.9

## 0.3.6 (June 17th, 2011)
* fix bug in Time/DateTime range detection
* (win32) fix bug where the Mysql2::Client object wasn't cleaned up properly if interrupted during a query
Expand Down Expand Up @@ -33,6 +36,13 @@
* BREAKING CHANGE: the ActiveRecord adapter has been pulled into Rails 3.1 and is no longer part of the gem
* added Mysql2::Client.escape (class-level) for raw one-off non-encoding-aware escaping

## 0.2.13 (August 16th, 2011)
* fix stupid bug around symbol encoding support (thanks coderrr!)

## 0.2.12 (August 16th, 2011)
* ensure symbolized column names support encodings in 1.9
* plugging sql vulnerability in mysql2 adapter

## 0.2.11 (June 17th, 2011)
* fix bug in Time/DateTime range detection
* (win32) fix bug where the Mysql2::Client object wasn't cleaned up properly if interrupted during a query
Expand Down
7 changes: 6 additions & 1 deletion ext/mysql2/result.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,15 @@ static VALUE rb_mysql_result_fetch_field(VALUE self, unsigned int idx, short int

field = mysql_fetch_field_direct(wrapper->result, idx);
if (symbolize_keys) {
VALUE colStr;
char buf[field->name_length+1];
memcpy(buf, field->name, field->name_length);
buf[field->name_length] = 0;
rb_field = ID2SYM(rb_intern(buf));
colStr = rb_str_new2(buf);
#ifdef HAVE_RUBY_ENCODING_H
rb_enc_associate(colStr, rb_utf8_encoding());
#endif
rb_field = ID2SYM(rb_to_id(colStr));
} else {
rb_field = rb_str_new(field->name, field->name_length);
#ifdef HAVE_RUBY_ENCODING_H
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.3.6"
VERSION = "0.3.7"
end

0 comments on commit 38005af

Please sign in to comment.