[freetds] [ freetds-Patches-1082171 ] patch for dbrpcparam

Thompson, Bill D (London) bill_d_thompson at ml.com
Thu Dec 9 10:13:05 EST 2004


Hi,

here's my patch for dbrpcparam.

A bug was recently reported against this, as we were not handling null
input parameters properly.

Lengthy thought and investigation revealed that the BOL pages for
dbrpcparam are contradictory at best, misleading at worst.
The confusing sections relate to the maxlen and datalen parameters, and
how to signify a NULL input parameter.

my patch follows this "spec", taken from the sybase manual pages which
make much more sense than SQL BOL.... 

maxlen - For return parameters, this is the maximum desired byte length
for the RPC parameter value returned from the stored procedure. maxlen
is relevant only for values whose datatypes are not fixed in length-that
is, char, text, binary, and image values. If this parameter does not
apply (that is, if the type is a fixed length datatype such as SYBINT2)
or if you do not care about restricting the lengths of return
parameters, set maxlen to -1. maxlen should also be set to -1 for
parameters not designated as return parameters. 

datalen - The length, in bytes, of the RPC parameter to pass to the
stored procedure. This length should not count any null terminator. 

If type is SYBCHAR, SYBVARCHAR, SYBBINARY, SYBVARBINARY, SYBBOUNDARY, or
SYBSENSITIVITY, datalen must be specified. Passing datalen as -1 for any
of these datatypes results in the DBPROCESS referenced by dbproc being
marked as "dead," or unusable.

If type is a fixed length datatype, for example, SYBINT2, pass datalen
as -1. 

If the value of the RPC parameter is NULL, pass datalen as 0, even if
type is a fixed-length datatype. 


Bill

-----Original Message-----
From: freetds-bounces at lists.ibiblio.org
[mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of SourceForge.net
Sent: 09 December 2004 15:06
To: noreply at sourceforge.net
Subject: [freetds] [ freetds-Patches-1082171 ] patch for dbrpcparam


Patches item #1082171, was opened at 2004-12-09 15:05
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=1082171&gro
up_id=33106

Category: db-lib
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Bill Thompson (thompbil)
Assigned to: Nobody/Anonymous (nobody)
Summary: patch for dbrpcparam

Initial Comment:
Hi,

this patch is for the dblibrary rpc call api's.
our existing version did not handle NULL input 
parameters properly.

Bill

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=407808&aid=1082171&gro
up_id=33106
_______________________________________________
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds 
--------------------------------------------------------
 
If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Click here for important additional terms relating to this e-mail.     http://www.ml.com/email_terms/ 
--------------------------------------------------------
 



More information about the FreeTDS mailing list