Skip to Content.
Sympa Menu

freetds - Re: patches committed, changes afoot

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: patches committed, changes afoot
  • Date: Mon, 10 Jun 2002 15:54:57 -0400


> Here a bug report for tsql, triggered by the very first query I tried
> against it:
>
> 1> select count(*) from all_docs
> 2> go
>
> Attempting to convert unknown source type 38

Interesting. Sybase returns a type of INT4 from count(*) because count()
can never be NULL. MS returns an INTN instead, not sure of the reason.
In either case it is an error to call tds_convert() on a nullable type, so
here is the fix: replace the call to tds_convert in tsql.c with:

int ctype = tds_get_conversion_type(
tds->res_info->columns[i]->column_type,
tds->res_info->columns[i]->column_size);
tds_convert(NULL,ctype,

&tds->res_info->current_row[tds->res_info->columns[i]->column_offset],
tds->res_info->columns[i]->column_size,
SYBVARCHAR,tmpbuf,-1);

I'll check it in a little later today.

Brian




Archive powered by MHonArc 2.6.24.

Top of Page