mysql2 0.2.19b5 → 0.2.19b6

Sign up to get free protection for your applications and to get access to all the features.
@@ -177,7 +177,6 @@ static VALUE nogvl_close(void *ptr) {
177
177
  #endif
178
178
 
179
179
  mysql_close(wrapper->client);
180
- xfree(wrapper->client);
181
180
  }
182
181
 
183
182
  return Qnil;
@@ -188,6 +187,7 @@ static void rb_mysql_client_free(void * ptr) {
188
187
 
189
188
  nogvl_close(wrapper);
190
189
 
190
+ xfree(wrapper->client);
191
191
  xfree(ptr);
192
192
  }
193
193
 
@@ -149,8 +149,6 @@ module ActiveRecord
149
149
  if value.kind_of?(String) && column && column.type == :binary && column.class.respond_to?(:string_to_binary)
150
150
  s = column.class.string_to_binary(value).unpack("H*")[0]
151
151
  "x'#{s}'"
152
- elsif value.kind_of?(BigDecimal)
153
- value.to_s("F")
154
152
  else
155
153
  super
156
154
  end
@@ -314,12 +312,13 @@ module ActiveRecord
314
312
  end
315
313
 
316
314
  def add_limit_offset!(sql, options)
317
- limit, offset = options.fetch(:limit, 18446744073709551615), options[:offset]
315
+ limit, offset = options[:limit], options[:offset]
318
316
  if limit && offset
319
317
  sql << " LIMIT #{offset.to_i}, #{sanitize_limit(limit)}"
320
318
  elsif limit
321
319
  sql << " LIMIT #{sanitize_limit(limit)}"
322
320
  elsif offset
321
+ limit = 18446744073709551615 if limit.nil?
323
322
  sql << " LIMIT #{sanitize_limit(limit)} OFFSET #{offset.to_i}"
324
323
  end
325
324
  sql
@@ -1,3 +1,3 @@
1
1
  module Mysql2
2
- VERSION = "0.2.19b5"
2
+ VERSION = "0.2.19b6"
3
3
  end
@@ -17,17 +17,17 @@ describe Mysql2::Client do
17
17
  if defined? Encoding
18
18
  it "should raise an exception on create for invalid encodings" do
19
19
  lambda {
20
- c = Mysql2::Client.new(:encoding => "fake")
20
+ c = Mysql2::Client.new(DatabaseCredentials['root'].merge(:encoding => "fake"))
21
21
  }.should raise_error(Mysql2::Error)
22
22
  end
23
23
 
24
24
  it "should not raise an exception on create for a valid encoding" do
25
25
  lambda {
26
- c = Mysql2::Client.new(:encoding => "utf8")
26
+ c = Mysql2::Client.new(DatabaseCredentials['root'].merge(:encoding => "utf8"))
27
27
  }.should_not raise_error(Mysql2::Error)
28
28
 
29
29
  lambda {
30
- c = Mysql2::Client.new(:encoding => "big5")
30
+ c = Mysql2::Client.new(DatabaseCredentials['root'].merge(:encoding => "big5"))
31
31
  }.should_not raise_error(Mysql2::Error)
32
32
  end
33
33
  end
@@ -416,10 +416,10 @@ describe Mysql2::Client do
416
416
  it "#more_results? should work" do
417
417
  @multi_client.query( "select 1 as 'set_1'; select 2 as 'set_2'")
418
418
  @multi_client.more_results?.should == true
419
-
419
+
420
420
  @multi_client.next_result
421
421
  @multi_client.store_result
422
-
422
+
423
423
  @multi_client.more_results?.should == false
424
424
  end
425
425
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mysql2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.19b5
4
+ version: 0.2.19b6
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-14 00:00:00.000000000 Z
12
+ date: 2013-02-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: eventmachine
@@ -154,4 +154,3 @@ test_files:
154
154
  - spec/mysql2/result_spec.rb
155
155
  - spec/rcov.opts
156
156
  - spec/spec_helper.rb
157
- has_rdoc: