Skip to Content.
Sympa Menu

freetds - Re: invalid data returned when querying data of type:REAL

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Jamie Steffen <jamie_steffen AT csgsystems.com>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>, camber AT umcc.ais.org
  • Subject: Re: invalid data returned when querying data of type:REAL
  • Date: Tue, 04 Apr 2000 12:25:26 -0500


Interesting....I did'nt realize it was a PHP issue. Anyway, we are using PHP
3.0.15. I
have tried compiling the FreeTDS library using --with-sybase-ct but get
multiple
errors. If I could get the binaries to compile and run with the sybase-ct
parameter
that would be excellent. Any suggestions?

Brian Bruns wrote:

> This is a bug in PHP 3.0.11 and higher (at least 3.0.4 is the last know
> working one, but I haven't tested 5->10). I've replicated this under real
> sybase dblib on AIX too. Using --with-sybase-ct does correct the problem.
> The offending line from the header file (php3_sybase.h) is this:
>
> #define floatcol(i) ((float) *(DBFLT8 *) dbdata(sybase_ptr->link,i))
>
> >From the looks of it somebody fixed floats by commenting then out of the
> switch in sybase.c and letting dbconvert() take care of it. You could do
> the same with reals:
>
> /*case SYBFLT8:*/
> case SYBREAL: {
> result->value.dval = (double) floatcol(offset);
> result->type = IS_DOUBLE;
> break;
> }
>
> becomes:
>
> /*case SYBFLT8:*/
> /*
> ** floatcol() mangles the 4byte reals, so let dbconvert handle it -- bsb
> case SYBREAL: {
> result->value.dval = (double) floatcol(offset);
> result->type = IS_DOUBLE;
> break;
> }
> */
>
> Unfornately, that runs into a second problem of extraneous text trailing
> the number, which I don't have time to look at right now.
>
> I'll try to look at it more tonight and get a patch together for the php
> folks.
>
> Brian
>
> On Mon, 3 Apr 2000, Jamie Steffen wrote:
>
> > All's well on this front aside from one minor exception. When a query from
> > our SQL database (v.6.5) is made from a field of type:REAL the return is
> > always '0'. Has anyone come across this issue or is anyone aware of it?
> > All
> > other queries made return the correct results.
>
> ---
> You are currently subscribed to freetds as: jamie_steffen AT csgsystems.com
> To unsubscribe, forward this message to $subst('Email.Unsub')

--
Jamie Steffen
x7798/jamie_steffen AT csgsystems.com
Web Administrator/CNS
CSG Systems, Inc.






Archive powered by MHonArc 2.6.24.

Top of Page