Skip to Content.
Sympa Menu

freetds - Re: SQL 7.0 Dates not coming through properly

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Wasson, Tim" <WassonT AT kochind.com>
  • To: "'TDS Development Group'" <freetds AT franklin.oit.unc.edu>
  • Subject: Re: SQL 7.0 Dates not coming through properly
  • Date: Fri, 23 Jun 2000 08:40:56 -0500


You da MAN!

Works great now. No PHP crashes. Dates are looking pretty good, that is,
dates that aren't 1/1/1900. I've got a bunch of dates that I've defaulted
to 1/1/1900 when we don't know the actual date, and those are coming
through as Feb 7, 2036 6:28 AM. Is this a "unix interpreting 2 digit years"
being different from Windows representing 2 digit years? On the sun box I
previously mentioned, we've been doing a workaround by only pulling data
after Jan 2 1900, and I think it was this same issue.

Should I just force my default date to 1/2/1900 and live with things, or is
there something quick that can be done? This isn't a show-stopper for me,

Tim Wasson
Koch Industries
Wichita KS, USA



> -----Original Message-----
> From: Mark Schaal [SMTP:mark AT champ.tstonramp.com]
> Sent: Thursday,June 22,2000 5:10 PM
> To: TDS Development Group
> Subject: [freetds] Re: SQL 7.0 Dates not coming through properly
>
> >
> > I've got a SQL 7.0 Desktop db server on an NT box. When accessing this
> db
> > thorugh PHP (compiled with sybase support pointing at the freetds
> > libraries), if I include a date field in the query, my PHP returns bad
> data.
> > Also, on a Sun box accessing the same database with the Sybase CT
> libraries,
> > we are getting strange date returns. Dates that should be one day apart
> in
> > 1996, are showing up as 25 Jan 1900 8:50 and 25 Jan 1900 8:53, etc.
> >
> > We have SQL 6.5 databases that work fine on the Sun box. The fact that
> I've
> > seen this with two different libraries makes me wonder if SQL 7.0 is
> broken
> > wrt the sybase protocol when it comes to dates.
> >
> > Has anyone had dates work properly with SQL 7.0?
> >
> > Tim Wasson
> > Koch Industries
> > Wichita KS USA
>
>
> I noticed there is a fix in the code, but I think it parses the
> TDS_LOGIN_ACK_TOKEN incorrectly. Try the following patch, i.e.
> move the "tds_get_n(tds, NULL, len-4);" call down two lines.
> Let us know if it works. (I've got to find time to start testing
> of this stuff.)
>
>
> *** token.c.orig Thu Jun 22 15:00:49 2000
> --- token.c Thu Jun 22 15:06:20 2000
> ***************
> *** 170,178 ****
> case TDS_LOGIN_ACK_TOKEN:
> len = tds_get_smallint(tds);
> ack = tds_get_byte(tds);
> - tds_get_n(tds, NULL, len-4);
> major_ver = tds_get_byte(tds);
> minor_ver = tds_get_byte(tds);
> tds_get_byte(tds);
> #ifdef HW_BIG_ENDIAN
> if (major_ver==7) {
> --- 170,178 ----
> case TDS_LOGIN_ACK_TOKEN:
> len = tds_get_smallint(tds);
> ack = tds_get_byte(tds);
> major_ver = tds_get_byte(tds);
> minor_ver = tds_get_byte(tds);
> + tds_get_n(tds, NULL, len-4);
> tds_get_byte(tds);
> #ifdef HW_BIG_ENDIAN
> if (major_ver==7) {
>
> Mark
> --
> Mark J. Schaal Phone: (909)
> 620-7724
> TST On Ramp Fax: (909) 620-8174
> System Administrator E-Mail: mark AT tstonramp.com
>
> ---
> You are currently subscribed to freetds as: WassonT AT kochind.com
> To unsubscribe, forward this message to
> $subst('Email.Unsub')
>





Archive powered by MHonArc 2.6.24.

Top of Page