File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ def initialize(opts = {})
36
36
when :reconnect , :local_infile , :secure_auth
37
37
send ( :"#{ key } =" , !!opts [ key ] ) # rubocop:disable Style/DoubleNegation
38
38
when :connect_timeout , :read_timeout , :write_timeout
39
- send ( :"#{ key } =" , opts [ key ] . to_i )
39
+ send ( :"#{ key } =" , opts [ key ] ) unless opts [ key ] . nil?
40
40
else
41
41
send ( :"#{ key } =" , opts [ key ] )
42
42
end
Original file line number Diff line number Diff line change @@ -352,6 +352,12 @@ def run_gc
352
352
} . to raise_error ( Mysql2 ::Error )
353
353
end
354
354
355
+ it "should allow nil read_timeout" do
356
+ client = Mysql2 ::Client . new ( :read_timeout => nil )
357
+
358
+ expect ( client . read_timeout ) . to be_nil
359
+ end
360
+
355
361
context "#query" do
356
362
it "should let you query again if iterating is finished when streaming" do
357
363
@client . query ( "SELECT 1 UNION SELECT 2" , :stream => true , :cache_rows => false ) . each . to_a
You can’t perform that action at this time.
0 commit comments