freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: Brian Bruns <camber AT ais.org>
- To: TDS Development Group <freetds AT franklin.oit.unc.edu>
- Subject: Re: Bizarre date wraparound bug
- Date: Tue, 16 Oct 2001 19:08:40 -0400 (EDT)
from src/tds/convert.c:
TDS_INT tds_convert_datetime(int srctype,unsigned char *src,int
desttype,unsigned char *dest,TDS_INT destlen)
{
TDS_INT dtdays, dttime;
time_t tmp_secs_from_epoch;
switch(desttype) {
case SYBCHAR:
case SYBVARCHAR:
/* FIX ME -- This fails for dates before 1902 or after 2038 */
if (destlen<0) {
memset(dest,' ',30);
} else {
memset(dest,' ',destlen);
}
if (!src) {
*dest='\0';
return 0;
}
memcpy(&dtdays, src, 4);
memcpy(&dttime, src+4, 4);
Anybody wanna take a crack at fixing it?
On Tue, 16 Oct 2001, Craig Davison wrote:
> On Tue, 16 Oct 2001, Michael Peppler wrote:
>
> > I guess FreeTDS takes a short cut and converts the data to standard
> > time_t format (which is OK for most things, of course).
>
> Sorry for the numerous posts, but maybe this should be in the FAQ?
>
> Thanks for your reply.
>
>
-
Bizarre date wraparound bug,
Craig Davison, 10/16/2001
- <Possible follow-up(s)>
- Re: Bizarre date wraparound bug, Craig Davison, 10/16/2001
- Re: Bizarre date wraparound bug, Craig Davison, 10/16/2001
- Re: Bizarre date wraparound bug, Michael Peppler, 10/16/2001
- Re: Bizarre date wraparound bug, Craig Davison, 10/16/2001
- Re: Bizarre date wraparound bug, Brian Bruns, 10/16/2001
- Re: Bizarre date wraparound bug, Lowden, James K, 10/17/2001
- Re: Bizarre date wraparound bug, James K. Lowden, 10/24/2001
Archive powered by MHonArc 2.6.24.