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 = {})
3636 when :reconnect , :local_infile , :secure_auth
3737 send ( :"#{ key } =" , !!opts [ key ] ) # rubocop:disable Style/DoubleNegation
3838 when :connect_timeout , :read_timeout , :write_timeout
39- send ( :"#{ key } =" , opts [ key ] . to_i )
39+ send ( :"#{ key } =" , opts [ key ] ) unless opts [ key ] . nil?
4040 else
4141 send ( :"#{ key } =" , opts [ key ] )
4242 end
Original file line number Diff line number Diff line change @@ -351,6 +351,12 @@ def run_gc
351351 Mysql2 ::Client . new ( :write_timeout => -1 )
352352 } . to raise_error ( Mysql2 ::Error )
353353 end
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
354360
355361 context "#query" do
356362 it "should let you query again if iterating is finished when streaming" do
You can’t perform that action at this time.
0 commit comments