Skip to Content.
Sympa Menu

freetds - RE: MS SQLServer 2000 and "for xml auto" command

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Brian Bruns" <camber AT ais.org>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: RE: MS SQLServer 2000 and "for xml auto" command
  • Date: Thu, 29 Aug 2002 11:57:44 -0400



Ok, I think I know what is going on. In tds7_process_result() there is a
switch statement that sets curcol->column_unicodedata if the column type
is a unicode capable datatype. ntext is missing from the list. I don't
have time (nor am i somewhere convenient) to make a patch right now but we
really should be calling is_unicode() on the datatype instead of having
this int the switch statement, and then fixing it in the header, nice and
clean.

Brian

> Brian gets the prize!
>
> Every other byte is a null! Which in turn throws off the normal print
> out of the value. If I iterate through the buffer I get a result like:
>
>
> Value: <
> Value:
> Value: t
> Value:
> Value: d
> Value:
> Value: s
> Value:
> Value: _
> Value:
> Value: t
> Value:
> Value: e
> Value:
> Value: s
> Value:
> Value: t
> ...
>
> I'll try to run down where the unicode to ascii conversion happens and
> see if I can pin point it.
>
> Thanks again,
> chad
>
> Brian Bruns wrote:
>
> >Chad,
> >
> >Just a thought, it may not turn up anything but....
> >
> >in the unittest can you have it print buf[0], buf[1] etc... up to say 10
> >or so? I'm wondering if something is going on with the unicode to ascii
> >conversion and the second byte (buf[1]) is a null and thus appearing to be
> >cut off when handling via C.
> >
> >Brian
> >
> >
> >
> >>I am using a snapshot from 8/22 - which, if I may say, is working quite
> >>nicely for everything else I am doing.
> >>
> >>I have debugged the issue all the way to src/tds/read.c and the
> >>tds_get_n function. I can see nothing wrong with the way the code copies
> >>out the contents of tds->in_buf to the destination but yet I get just
> >>the opening < for the result.
> >>
> >>I also thought perhaps I was fetching the results incorrectly so I
> >>altered one of the unit tests in src/dblib/unittests (t0013.c) to use my
> >>select and it has the same issue.
> >>
> >>If I can be of any help in getting this worked out please just let me
> >>know.
> >>
> >>Thanks
> >>chad
> >>
> >>Lowden, James K wrote:
> >>
> >>
> >>
> >>>>From: Chad Enney [mailto:Chad.Enney AT noaa.gov]
> >>>>Sent: August 28, 2002 4:21 PM
> >>>>
> >>>>RedHat Linux 7.3 connecting to a MS SQLServer 2000 using TDS
> >>>>protocol 7.0
> >>>>
> >>>>SELECT * FROM tds_test FOR XML AUTO;
> >>>>
> >>>>Everything looks fine but I only get back the very first character of
> >>>>the returned result. I have turned on the tdsdump file and
> >>>>can clearly
> >>>>see the entire result being returned on the stack. The type is being
> >>>>returned as a SYBNTEXT - and I can retrieve standard columns of this
> >>>>type just fine.
> >>>>
> >>>>
> >>>>
> >>>>
> >>>Chad,
> >>>
> >>>Thanks for the PR; xml stuff is new turf.
> >>>
> >>>What version of FreeTDS are you using, or what's the date of your
> >>>snapshot?
> >>>
> >>>--jkl
> >>>
> >>>
> >>>
> >
> >---
> >You are currently subscribed to freetds as: [Chad.Enney AT noaa.gov]
> >To unsubscribe, forward this message to $subst('Email.Unsub')
> >
> >
> >




Archive powered by MHonArc 2.6.24.

Top of Page