[freetds] ODBC date format?
entropy at freetds.org
entropy at freetds.org
Fri Jun 9 12:20:33 EDT 2006
ZIGLIO, Frediano, VF-IT wrote:
>>Revision 1.316 of src/odbc/odbc.c added milliseconds to the ODBC date
>>format. This broke things for my users after an upgrade from
>>I have reverted this change locally, and I think it should be
>>in the master copy as well.
>>Freddy, this change was yours. Do you remember the
>>rationale? Do you
>>agree that it should be reset back to the standard date format?
> Well... I don't even rememeber what I ate yesterday :)
> The change is
> 315&r2=1.316&sortby=date that is on ChangeLog
> Thu Apr 15 21:25:15 CET 2004 Frediano Ziglio <freddy77 at angelfire.com>
> * src/odbc/odbc.c: fix date format
> * src/tds/convert.c: fix date approximation
> perhaps is related to DBD::ODBD fixes (seeing near changes)?? I don't
> know... there must be a reason but I don't really remember. I think is
> better to find your problem and try to fix it. Which is the correct
> bahavior?? Using ODBC 3 you can set precision that for date is the
> number of digits, this is not yet implemented. Which is the default? I
> think the date format is used only converting date to char that is
> binding date to a char and doing a simple select that return date... Am
> I wrong?
Yes, we do a lot of that sort of thing in our environment. I know we
could work around it by having the users find all their date output
selects and explicitly convert them to the desired format. But
meanwhile we would potentially have lots of breakage, so it's simpler
for now just to revert globally to the old format.
I don't know which is the default format in a "normal" ODBC environment,
because my only ODBC environment is FreeTDS/unixODBC/DBD::ODBC.
If we can have hooks to set the precision and I can get the old behavior
somehow, I'd be happy with leaving the default precision with
milliseconds in place. I tried looking through the ODBC documentation,
but I think adding this configuration option is over my head.
On a sort-of related note, I just checked in some format changes for
default and en_US locales in locales.conf. With this change the format
produced by FreeTDS using the DB-Library API is identical to Sybase's
output. I think this is the correct behavior, but if there's a reason
for a different default behavior then please let me know.
More information about the FreeTDS