Skip to Content.
Sympa Menu

freetds - Re: Strange data results....

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: James K. Lowden <jklowden AT speakeasy.org>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: Re: Strange data results....
  • Date: Sun, 9 Jun 2002 14:06:29 -0400


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




Archive powered by MHonArc 2.6.24.

Top of Page