Skip to Content.
Sympa Menu

freetds - Re: How to read Strings bigger than 255 chars

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Michael Peppler <mpeppler AT peppler.org>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: Re: How to read Strings bigger than 255 chars
  • Date: Mon, 4 Jun 2001 17:30:48 -0700 (PDT)


James K. Lowden writes:
> Michael Peppler wrote:
>
> > >From what I'm seeing, MS is, by default under TDS 7.0, actually sending
> > > the entire text clob all in one go. So technically they are sticking
> > to
> > > the protocol. It just makes the maxlength value useless for
> > preallocating
> > > memory!
> >
> > What?!?!
> >
> > Don't they honour the default TEXTSIZE value?
> >
> > (oh, and of course they don't allow setting CS_OPT_foo via
> > ct_options() either, so you have to execute it as a language statement
> > for that connection)
>
> Well... MS doesn't offer a ct-lib client, so we can't really say what they
> do. :-{ Would
> better ct_option support in FreeTDS make DBD::Sybase better?

Maybe. But none of the ct_options() calls work when using the Sybase
libs and MS-SQL, so I suspect that this might be another protocol
glitch.

>
> > > If freetds were to allow a "set textsize" to be executed
> > automatically on
> > > connect, ct_describe would return a sane value and everyone should be
> > > happy.
>
> If I read Brian's message right, ct_describe doesn't return a value
> representative of
> TEXTSIZE until it's been explicitly set, which is (as Mr.Friesen observes)
> less than
> helpful. A pain in the tookus, my grandfather would have said.
>
> The documentation http://larr.unm.edu/~owen/SQLBOL70/html/globals_26.htm
> says:
>
> "The default size is 4096 bytes (4 KB)."
>
> Houston, we have a bug.

:-)


>
> May I offer a suggestion?
>
> If you're going to send "set textsize" on connect, maybe the default value
> (in the absence of
> a config file value) should be 32 KB cf. Sybase or 4 KB cf. Microsoft?
> Principle of least
> astonishment and all that? I think that would cut down on the number of
> questions. Better
> truncated data (which the calling application can should test for in any
> case) than a broken
> query.

I think that that sounds good. That is definitely what I would have
expected to happen based on my (limited) knowledge of the MS-SQL
values for @@textsize.

> There's a fly in the ointment, too: unicode. "Textsize" is measured in
> bytes, not
> characters. Just when you thought you knew what text is, the world goes
> multilingual on you.
>

Indeed. But for the purpose of allocating memory I suspect that the
@@textsize values should work OK (I hope!)

Michael
--
Michael Peppler - Data Migrations Inc. - mpeppler AT peppler.org
http://www.mbay.net/~mpeppler - mpeppler AT mbay.net
International Sybase User Group - http://www.isug.com
Sybase on Linux mailing list: ase-linux-list AT isug.com




Archive powered by MHonArc 2.6.24.

Top of Page