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

James Cameron cameron at stl.dec.com
Thu May 10 03:05:28 EDT 2001


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/



More information about the FreeTDS mailing list