Skip to Content.
Sympa Menu

freetds - Re: [freetds] [ freetds-Patches-731907 ] Choosing datalength when binding fixed types

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddyz77 AT tin.it>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] [ freetds-Patches-731907 ] Choosing datalength when binding fixed types
  • Date: Sat, 03 May 2003 18:47:36 -0000

Il sab, 2003-05-03 alle 20:12, SourceForge.net ha scritto:
> Patches item #731907, was opened at 2003-05-03 18:12
> Message generated for change (Tracker Item Submitted) made by Item Submitter
> You can respond by visiting:
> https://sourceforge.net/tracker/?func=detail&atid=407808&aid=731907&group_id=33106
>
> Category: db-lib
> Group: None
> Status: Open
> Resolution: None
> Priority: 5
> Submitted By: Arnar Birgisson (arnar)
> Assigned to: Nobody/Anonymous (nobody)
> Summary: Choosing datalength when binding fixed types
>
> Initial Comment:
> When binding parameters of fixed-length types in dblib,
> the parameter "datalen" passed to dbrpcparam should be
> (almost) ignored.
>
> Current FreeTDS behaviour is to use the datalen
> parameter to determine how many bytes to copy from the
> parameter into the rpc message. Sybase and mssql
> documentation state that for fixed types, datalen
> should be set to -1, and when freetds passes -1 to
> memcpy, the application segfaults.
>
> This patch changes param_info_alloc, which is called
> from dprpcparam, to check if we are dealing with a
> fixed-size type, and if so, then it uses
> tds_get_size_by_type to set the relevant member in
> TDSCOLINFO and pass to memcpy.
>
> In the case of variable-sized types, the original
> behaviour is pertained.
>
> This should fix my earlier reported bug no. 731810, but
> I don't know if it breaks anything else.

Hi Arnar!

It shouldn't break anything. I modified it and applied.

freddy77






Archive powered by MHonArc 2.6.24.

Top of Page