rails-sqlserver/tiny_tds — Issue #55: Querying failed if target table has datetime column on Windows
Author: yasuyuki
Created: 2011-10-19 01:24:28+00:00
State: open

client = TinyTds::Client.new(:username => 'sa', :password => 'secret', :host => 'database')
result = client.execute("SELECT * FROM [table_without_datetime]")
result.each do |row| # works fine
p row
end

# but this crashes with "ArgumentError - argument out of range"
result = client.execute("SELECT * FROM [table_with_datetime]")
result.each do |row| # crash!
p row
end

stack trace
C:/path/to/script_file.rb:9:in `local'
C:/path/to/script_file.rb:9:in `each'

environment
RubyInstaller 1.8.7-p352
ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-mingw32]
tiny_tds (0.4.5 x86-mingw32)
WindowsXP SP3