[freetds] Compiling Against FreeTDS 0.95 w/7.3 TDSVER Features Possible?
freddy77 at gmail.com
Sun Nov 22 09:27:37 EST 2015
2015-11-22 0:42 GMT+00:00 Ken Collins <ken at actionmoniker.com>:
> On November 21, 2015 at 11:13:00 AM, Frediano Ziglio (freddy77 at gmail.com)
> 2015-11-15 20:14 GMT+00:00 Ken Collins <ken at metaskills.net>:
>> I am in the process of upgrading the Ruby C extensions to FreeTDS from
>> 0.91 to 0.95.
>> The primary goal is to also support using TDSVER 7.3 and the newly
>> supported 2008 data types.
>> Is this possible to use these new types in 0.95 when many of the types are
>> not defined in sybdb.h? For example here is a diff of that file when
>> comparing 0.95 to master.
>> For example, I can see that dbcoltype() is returning integers that match
>> these below. I can even see the binary data, but I am unsure how what API
>> functions I need to use this data. So far dbdatecrack() is not working. Any
>> SYBMSDATE = 40
>> SYBMSTIME = 41
>> SYBMSDATETIME2 = 42
>> SYBMSDATETIMEOFFSET = 43
> How does it sound this patch (as a start)
> Looks great! I'm interested in knowing how DBDATETIMEALL might be used.
> Would this be the structure returned for the new date crack?
dbdata. Is already returned in this way, just there was no definition
for the structure.
> I've created this issue
> (https://github.com/rails-sqlserver/tiny_tds/issues/244) on our project to
> tracks this. Thanks and I'll watch master for updates.
I pushed some changes to master to integrate dbanydatecrack. This
function use new DBDATEREC2 type which change milliseconds to
nanoseconds in the DBDATEREC structure and accepts an additional type
parameter (which can be returned by dbcoltype) for the type.
So you can use dbdata+dbcoltype+dbanydatecrack to parse any date/time
type (even future BIGTIME or whatever). The idea is to backport these
changes in 0.95 too.
Could you try if works for you? I extended a test and is actually working.
More information about the FreeTDS