rails-sqlserver/tiny_tds — Issue #58: argument out of range for datetime fields on linux (similar to issue #55)
Author: gardwired
Created: 2011-11-06 11:30:37+00:00
State: open

hi, i am running into this same issue as #55, but on debian linux ruby 1.8.7p320, tiny_tds 0.5.0 and freetds 0.91 qyering against windows 2000/sqlserver 2000 virtual machine (vmware). ie ruby is all on linux. i was getting these "statement invalid...argument out of range" errors on any query that has a datetime field (so almost all of my queries fail because of updated_at/created_at). this is a real show stopper. am really wanting to dump odbc. other details are that i compiled freetds without odbc, default tds 7.1 and enabling ms libs. the install all seemed to go fine (debian lenny doesnt have freetds 0.91 as yet).

i was getting the errors in rails 2.3.14 console so i then tried using TinyTds.client directly. same issue (argument out of range) when i try to iterate through result. fine if i dont select datetime fields.

please advise. am willing to help debug if needed. again, this doesn't appear to me to be a windows issue as these queries run fine on mssql query analyzer. it is only when you try to actually read the field in tds (convert string to Time?) that i pukes. i am not (and would prefer not to) use /etc/freetds/freetds.conf unless i have to to get this to work.

any ideas?