Skip to Content.
Sympa Menu

freetds - Re: set textsize 1048576 fails

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Brian Bruns <camber AT ais.org>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: set textsize 1048576 fails
  • Date: Fri, 26 Oct 2001 06:43:52 -0400 (EDT)


I assume the breaking point is somewhere close to amount of memory on the
box?

Culprit is tds_process_col_info() it adds the column_size (which will be a
function of textsize) to the row_size and calls tds_alloc_row() to malloc
an appropriately sized row buffer. What we used to do was to allocate a
column_size of sizeof(void *) and then dynamically allocate the room for a
blob object (text or image) dynamically at fetch time in
tds_process_row().

I don't recall changing this behaviour (though my memory is not what it
used to be), but that's why it no longer works. (BTW, obviously if the
actually size of the text field is greater than real memory then we just
pushed the problem to fetch time, but that is rarely the case).

Here's some possible changes:
revision 1.47
date: 1999/12/01 03:20:35; author: camber; state: Exp; lines: +192 -54
Fixed text/image bug in TDS 5.0 (row buffer allocation)
Cleanup things up and added some descriptions to functions in token.c
----------------------------
revision 1.46
date: 1999/11/29 12:58:14; author: camber; state: Exp; lines: +8 -3
fixes to text handling for TDS 7.0


Brian

On Fri, 26 Oct 2001, James Cameron wrote:

> James Cameron wrote:
> > I've yet to try the current CVS copy.
>
> I've tried it. Same problem there.
> Got any ideas, Brian?
>
> I took the current CVS copy, pushed it through the Debian packaging
> process, installed the result, confirmed the library had recent CVS
> idents, restarted apache, reloaded my test page.
>
> The test page looks like this;
>
> <pre>
> <?php
>
> $link = sybase_connect('database','username','password');
> if ($link == 0) { echo "connect failed\n"; exit; }
>
> function query($link, $text) {
> echo "$text\n";
> $result = sybase_query($text, $link);
> var_dump($result);
> if ($result < 1) { echo "query failed\n"; return; }
> while($row = sybase_fetch_row($result)) { var_dump($row); }
> }
>
> query($link, 'set textsize 1048576');
> query($link, 'select @@version');
>
> # successful run without set textsize
> # select @@version
> # resource(2) of type (sybase-ct result)
> # array(1) {
> # [0]=>
> # string(188) "Microsoft SQL Server 7.00 - 7.00.842 (Intel X86)
> # Mar 2 2000 06:49:37
> # Copyright (c) 1988-1998 Microsoft Corporation
> # Enterprise Edition on Windows NT 4.0 (Build 1381: Service Pack
> 6)
> # "
> # }
>
> # failed run with set textsize
> # set textsize 1048576
> # bool(false)
> # query failed
> # select @@version
> # bool(false)
> # query failed
>
>
> ?>
>
>





Archive powered by MHonArc 2.6.24.

Top of Page