Skip to Content.
Sympa Menu

freetds - RE: TODO

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: "'TDS Development Group'" <freetds AT franklin.metalab.unc.edu>
  • Subject: RE: TODO
  • Date: Wed, 4 Sep 2002 13:39:30 -0400


> From: Thompson, Bill D (London) [mailto:ThompBil AT exchange.uk.ml.com]
> Sent: September 4, 2002 12:43 PM
>
> If for example we tried to convert a VARCHAR of 0 length to a
> CHAR, the same
> error would arise, even through dbconvert(), as these are
> different types.
> The problem is inability to distinguish between TDS_FAIL and a valid
> returned length of 0.
...
> I think we should change all references to TDS_FAIL in
> convert.c ( and sub
> functions in other files) to something like TDS_CONVERT_FAIL
> (#defined to -1)

I saw that "return TDS_FAIL" in tds_convert and thought, "What is the
definition of this function? It looks confused."

I don't think I'd change tds_convert to return -1. Instead, I'd change it
not to launch an error message when the expected conversion length is zero.
That is, if, to take your example, the input data length is zero, we'd
expect a zero output length and shouldn't emit a message.

I saw the guards in dbconvert() and decided I didn't have to worry about
being handed a zero-length input buffer.

/**
* Converts unlike types, supports
* dbconvert(), ctconvert(), and [odbc func]. For supported
* types, see tds_willconvert().
*
* If the destination is of type SYBVARVCHAR [etc],
* allocates a buffer that the caller is expected to free.
*
* Errors messages are expressed through CONVERSION_ERROR()
* in the event of an error.
*
* Returns:
* length of converted data, or
* zero (if input was zero length)
*
* Zero-length output indicates an error unless srclen is zero.
*/

How's that for a definition?

--jkl


The information contained in this transmission may contain privileged and
confidential information 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 for certain accounts we do not accept
orders and/or instructions by e-mail, and for those accounts we will not be
responsible for carrying out such orders and/or instructions. Kindly refrain
from sending orders or instructions by e-mail unless you have confirmed that
we accept such communications for your account. Please also note that to
satisfy regulatory requirements we review the outgoing and incoming e-mail
correspondence of staff members serving certain functions.





  • RE: TODO , (continued)
    • RE: TODO, Lowden, James K, 09/04/2002
    • Re: TODO, Brian Bruns, 09/04/2002
    • RE: TODO, Brian Bruns, 09/04/2002
    • RE: TODO, Thompson, Bill D (London), 09/04/2002
    • RE: TODO, Brian Bruns, 09/04/2002
    • RE: TODO, Thompson, Bill D (London), 09/04/2002
    • RE: TODO, Eric Deutsch, 09/04/2002
    • RE: TODO, Brian Bruns, 09/04/2002
    • RE: TODO, Thompson, Bill D (London), 09/04/2002
    • RE: TODO, Frediano Ziglio, 09/04/2002
    • RE: TODO, Lowden, James K, 09/04/2002
    • RE: TODO, Frediano Ziglio, 09/04/2002

Archive powered by MHonArc 2.6.24.

Top of Page