Skip to Content.
Sympa Menu

freetds - Re: numeric column size bug with TDS7

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: numeric column size bug with TDS7
  • Date: Sun, 21 Jan 2001 13:20:53 -0500 (EST)



I checked in a patch that touched on this, you might want to check the CVS
version to see if that fixes things.

Brian

On Thu, 18 Jan 2001, Gerry Jensen wrote:

> I'm using dblib from FreeTDS5.1 compiled for SQL Server 7 support in a
> C program. The following query returned unexpected results: "SELECT
> @@IDENTITY". In looking at the code, the problem is that the column size
> is shorter than it should be so the entire numeric returned is not being
> received (increasing the column size by one fixed the problem in this
> situation). In token.c, I see that tds_process_result() has the
> following code which contains 2 places which would affect the column
> size in this situation:
>
> if (is_numeric_type(curcol->column_type)) {
> >>> info->row_size += sizeof(TDS_NUMERIC) + 1;
> } else if (!is_blob_type(curcol->column_type)) {
> info->row_size += curcol->column_size + 1;
> }
>
>
> /* actually this 4 should be a machine dependent #define */
> remainder = info->row_size % 4;
> >>> if (remainder) info->row_size += (4 - remainder);
>
> However, neither of these are present in the tds7_process_result()
> function. I'm guessing that one (or both of them) should be in the tds7
> version as well. Anyone know which one should be there (or both or
> neither)? I looked in the snapshot as of a week or so ago, and I didn't
> see any change in this file.
>
> Thanks,
>
> Gerry
>
>
> ---
> You are currently subscribed to freetds as: [camber AT ais.org]
> To unsubscribe, forward this message to $subst('Email.Unsub')
>





Archive powered by MHonArc 2.6.24.

Top of Page