Skip to Content.
Sympa Menu

freetds - Bizarre date wraparound bug

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Craig Davison <cd AT securityfocus.com>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Bizarre date wraparound bug
  • Date: Tue, 16 Oct 2001 16:17:11 -0600 (MDT)


Hi - I've found a low-date bug, but I'm not sure whether the problem is
with freetds. I can reproduce it with a query in both sqsh (freetds 0.52)
and dbish (freetds 0.52, dbd::sybase 0.91). My server is MS SQL Server
2000 SP1. The problem is not reproducible using microsoft's isql and
Query Analyzer tools.

The problem is that I can't seem to get a query to return a date lower
than 1901-12-13 20:34:52 without the result wrapping to sometime in 2038.


With sqsh:

1> select cast('1901-12-13 20:45:52' as datetime), cast('1901-12-13
20:45:51' as datetime)
2> go

------------------- -------------------
Dec 13 1901 08:45PM Jan 19 2038 03:14AM

(1 row affected)

With dbish:

xxx@dbi:Sybase:xxx> select cast('1901-12-13 20:45:52' as datetime),
cast('1901-12-13 20:45:51' as datetime) /
COL(1),COL(2)
'Dec 13 1901 08:45PM','Jan 19 2038 03:14AM'
[1 rows of 2 fields returned]


Any ideas? I have not tried to reproduce this with freetds 0.53pre1 yet.

I have a workaround - cast the date to a varchar - but I thought I would
point out his bug.

Thanks

--
Craig Davison
SecurityFocus
(403) 213-3939 ext. 228





Archive powered by MHonArc 2.6.24.

Top of Page