tds_process_col_info() questions

Brian Bruns camber at
Wed Oct 6 21:50:50 EDT 1999

Actually it fails all the way around...its query dependant.

instead of:

if(curcol->column_type == SYBTEXT) {

it should be:

if(curcol->column_type == SYBTEXT) {
     curcol->column_size = tds_get_int(tds);
     tabnamesize = tds_get_smallint(tds);
     text_size += 6 + tabnamesize;

bytes 4 and 5 are a smallint indicating the size of the next field (which
is the table name). Why its a small int for table name size is puzzling to
me since the limit on table name is much shorter (although the table name
can be fully qualified like: pubs2.dbo.blurbs)

Look at tds_process_result() for TDS 5.0 to see how its done.  I'm not
sure why this never got pushed back into tds_process_col_info() (the 4.2



On Wed, 6 Oct 1999, Mark Schaal wrote:

> These questions are about the code for tds_process_col_info().
> (1) The SYBTEXT portion drains 12 bytes, but here (SQLServer 6.5) it
>     looks like 13 is the correct value.  Is 12 right for some other
>     platform?
> (2) All the tmp_rest stuff is just supposed to drain any remaining
>     bytes as indicated by the hdrsize, correct?  It looks like old
>     code that is no longer correct.
> I have a cleaned up version of tds_process_col_info() which I'll 
> upload tomorrow if no problems appear.
> Mark
> -- 
> Mark J. Schaal					Phone:      (909) 620-7724
> TST On Ramp					Fax:	    (909) 620-8174
> System Administrator				E-Mail: mark at

More information about the FreeTDS mailing list