Skip to Content.
Sympa Menu

freetds - FAQ Alpha src/tds/convert.c SYBDATETIME MSSQL-7.0 fix?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: James Cameron <cameron AT stl.dec.com>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: FAQ Alpha src/tds/convert.c SYBDATETIME MSSQL-7.0 fix?
  • Date: Thu, 10 May 2001 17:05:28 +1000


Dates are appearing blank when returned by queries. I saw the FAQ had a
fix. I've tried this and it did not work for me. They are still blank.
Has anyone got this working?

Question 3.5 of the FAQ http://www.freetds.org/faq.html#35

"MSSQL-7.0 has a known bug when communicating with big-endian machines.
Columns of type MONEY and DATETIME are returned as little-endian
regardless of what was requested. You have to change the ordering of
high and low words to get correct results.

The following message may be of some guidance:

in src/tds/numeric.c in method tds_money_to_string() added a
swap(&(money->mnyhigh), &(money->mnylow)) and something similar in
src/tdsconvert.c in method tds_convert_datetime()."

So I changed

case SYBDATETIME:
memcpy(dest,src,sizeof(TDS_DATETIME));

to

case SYBDATETIME:
swab(src,dest,sizeof(TDS_DATETIME));

but dates are still blank. Did I adjust the right section?


FreeTDS from CVS two days ago.
PHP 4.0.5
Alpha, Compaq Tru64 UNIX

--
James Cameron (cameron AT stl.dec.com)

http://www.linux.org/ http://www.linux.org.au/ http://www.freshmeat.net/




Archive powered by MHonArc 2.6.24.

Top of Page