Skip to Content.
Sympa Menu

freetds - large queries and TDS 7.0

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Brandon M. Reynolds" <breynolds AT comtime.com>
  • To: 'TDS Development Group' <freetds AT franklin.oit.unc.edu>
  • Subject: large queries and TDS 7.0
  • Date: Tue, 17 Oct 2000 12:12:23 -0400


SQL Server 7.0 does in fact use a packet size. The packet size
is configurable by the server. I'm not sure if you can change
it on a per session basis or what... It defaults to 4096.

Anyway to get this to work I think we need to change TDS_MAX_QUERY to 4096
and change from:

int tds_put_byte(TDSSOCKET *tds, unsigned char c)
{
/* FIX ME -- add packet size support */
if ((IS_TDS70(tds) && tds->out_pos>=TDS_MAX_QUERY) ||
(!IS_TDS70(tds) && tds->out_pos>=512)) {
tds_write_packet(tds,0x0);
tds_init_write_buf(tds);
}
tds->out_buf[tds->out_pos++]=c;
}

to:

int tds_put_byte(TDSSOCKET *tds, unsigned char c)
{
/* FIX ME -- add packet size support */
if ((IS_TDS70(tds) && tds->out_pos>=TDS_MAX_QUERY) ||
(!IS_TDS70(tds) && tds->out_pos>=512)) {
tds_write_packet(tds,0x0);
tds_init_write_buf(tds);
}
if(tds->out_pos >= tds->out_len) {
tds->out_buf = realloc(tds->out_buf,tds->out_len+2048);
tds->out_len += 2048;
}
tds->out_buf[tds->out_pos++]=c;
}

also:

out_len needs to be maintained, eg. initialize it in mem.c and update it/use
it in a couple of other places.

Brandon M. Reynolds Ph: (330) 644-3059
Systems Engineer Fax: (330) 644-8110
Commercial Timesharing Inc. Email: bmr AT comtime.com




Archive powered by MHonArc 2.6.24.

Top of Page