Skip to Content.
Sympa Menu

freetds - Re: [PATCH] msg_number to TDS_UINT

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Dave Brotherstone" <davegb AT pobox.com>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: Re: [PATCH] msg_number to TDS_UINT
  • Date: Sat, 26 Jan 2002 19:35:04 -0000


> On Sat, Jan 26, 2002 at 01:49:49PM -0500, Bob Kline wrote:
> > On Sat, 26 Jan 2002, Steve Langasek wrote:
>
> > > My concern is that this is being done specifically *because* of the
> > > line in dblib/dbutil.c:
>
> > > if( tds->msg_info->msg_number > 0 )
>
> > > If you change msg_number to be a uint, then this comparison will
> > > always be false.
>
> > Zero is a legitimate value for an unsigned integer.
>
> Ah, of course. Is this the intended meaning of the comparison, then, to
> check if msg_number != 0?

I also don't know the inner workings of tds (or freetds!), but this could be
a belt 'n braces check for messages - as a quick check reveals that "print"
style messages are passed (after a message token) with msg_number 0.
As errors are from 13000 to the maximum allowed by 32bit signed int
(0x7FFFFFFF), I see no problem in converting the msg_number to a TDS_INT.

The patch is not being done solely because of the line in dblib/dbutil.c, it
is that the msg_number is a 4 byte int, and hence can go over 65535, let
alone 32767.


I'm not sure what implications this has on other-endian machines.

Comments?

Dave.





Archive powered by MHonArc 2.6.24.

Top of Page