Skip to Content.
Sympa Menu

freetds - Re: [freetds] trouble passing (var)char data to and from storedprocedures

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <james.k.lowden AT alliancebernstein.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] trouble passing (var)char data to and from storedprocedures
  • Date: Thu, 16 Mar 2006 09:58:24 -0500

> On 2006/3/15, Allan Kim <akim AT freedom.com>:
> >
> > If I'm not mistaken, mssql_bind() is pretty much just a wrapper for
> > dbrpcparam() in rpc.c. That function normally logs an entry like
> > "dbrpcparam added parameter" -- if you don't see that in the dump
logs,
> > I'd suspect that you're failing input validation in dbrpcparam (most
of
> > which was added post-0.62).
>
> From: Alexander Urmazov
> Sent: Thursday, March 16, 2006 5:19 AM
>
> Yes, you are right. When I set length for input parameter to -1
> all became fine.

Well, well. I just added something to the TODO list. The db-lib rpc
functions check their input, but don't feed error messages back to the
calling application. When I wrote the code, I had in mind C
applications calling these routines directly, so the source of the
problem (if you check the return code) would be obvious. Better that
than failing downstream, somewhere in the guts of libtds....

At the time, even that much was novel. Most of the db-lib routines
don't check their inputs very carefully.

Howsomever, with two more layer atop db-lib (PHP and its extension) the
source becomes dramatically unclear, to the point where you have to
check the logs that something *didn't* appear. That's clever; I'm sorry
it's necessary.

In the future, all db-lib functions will validate their inputs and
generate appropriate error messages. This is very easy code to write;
anyone who wants to join in is more than welcome.

--jkl

-----------------------------------------
The information contained in this transmission may be privileged and
confidential and is intended only for the use of the person(s) named
above. If you are not the intended recipient, or an employee or agent
responsible
for delivering this message to the intended recipient, any review,
dissemination,
distribution or duplication of this communication is strictly prohibited. If
you are
not the intended recipient, please contact the sender immediately by reply
e-mail
and destroy all copies of the original message. Please note that we do not
accept
account orders and/or instructions by e-mail, and therefore will not be
responsible
for carrying out such orders and/or instructions. If you, as the intended
recipient
of this message, the purpose of which is to inform and update our clients,
prospects
and consultants of developments relating to our services and products, would
not
like to receive further e-mail correspondence from the sender, please "reply"
to the
sender indicating your wishes. In the U.S.: 1345 Avenue of the Americas, New
York,
NY 10105.



  • Re: [freetds] trouble passing (var)char data to and from storedprocedures, Lowden, James K, 03/16/2006

Archive powered by MHonArc 2.6.24.

Top of Page