Skip to Content.
Sympa Menu

freetds - Re: Strange data results....

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Franck Martin <franck AT sopac.org>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: Strange data results....
  • Date: 10 Jun 2002 19:46:39 +0000

Indeed the problem goes away...

I have done a cast to varchar in the select query and it works normally now...

Now, How do I lodge a bug on php and what should I type? Could you do it for me?

I suspect also this is why the image field does not work either? However I have heard that this problem is kind of fixed in php 4.2.0?

Thanks all for you help...

Cheers.
franck AT sopac.org

On Sun, 2002-06-09 at 18:06, James K.Lowden wrote:
On Sun, 9 Jun 2002 07:33:51 -0400 (EDT) "Bob Kline" <bkline AT rksystems.com>
wrote:
> On Sun, 9 Jun 2002, Franck Martin wrote:
> >
> > It seems indeed that it is related to non-null terminated strings.
> > From the flow of data from the capture I see that the string is not
> > terminated and only the pair of bytes before the string gives the
> > length of the string (ie 0400 for AN or 1c00 for Annual Reports).
> 
> It appears that PHP is looking at the value which represents the number
> of bytes in the data buffer, but is thinking that this value represents
> the number of characters in the data buffer.  Notice, for example, that
> the value for ReportType is always two characters, and PHP is always
> pumping out four single-byte characters (because that's how many bytes
> are present for two NVARCHAR characters).

Bob, I read your message and said aloud, "Ohhhhh!".  As a matter of fact,
I think nvarchars have bitten us before with PHP.  Good eye.  

Franck, 

Bob's hypothesis is easy to test:  Change your query to return varchar
instead of nvarchar.  If the problem goes away (and it will!), you might
want to file a pr with PHP.  

Please let us know what happens.  I would add this to the "known
behaviors" in the documentation if Bob is right.  

Regards, 

--jkl

---
You are currently subscribed to freetds as: [Franck AT sopac.org]
To unsubscribe, forward this message to $subst('Email.Unsub')



Archive powered by MHonArc 2.6.24.

Top of Page