Skip to Content.
Sympa Menu

freetds - Convert patches...

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: ZIGLIO Frediano <Frediano.Ziglio AT vodafoneomnitel.it>
  • To: "Freetds (E-mail)" <freetds AT franklin.metalab.unc.edu>
  • Subject: Convert patches...
  • Date: Fri, 2 Aug 2002 12:14:06 +0200


I start reviewing last convert patch.
I see that many work are shifted from tds to dblib/ctlib library. But many
conversion can be done in tds_convert (such as same type or other).

My intention for 0.6 release was a convert.c without any malloc in it (as
you can note applying my patches). I disappoint with this patch. It
reintroduce a lot of untested malloc (with relative core dumps...). It also
lower performance by copy 2 time buffer for CHAR/VARCHAR...

I think that we must pass to tds_convert pointer to final char buffer and
destination length (as before). tds_convert should fill destination buffer
until filling them. Library should then zero-terminate or padding (as
necessary) or return error. This solve the double copy, unnecessary memory
allocation and library problems. Some can disappoint that dblib/ctlib can be
called with destlen -1 or -2 (there is sufficient space). This is not a
problem, just fill destlen with maximun allowed (2GB in x86 architecture).

Someone also should write tests for all library conversion.

So, it seem we are back to the drawing board...

freddy77

=================================
"STRICTLY PERSONAL AND CONFIDENTIAL

This message may contain confidential and proprietary material for the sole
use of the intended recipient. Any review or distribution by others is
strictly prohibited. If you are not the intended recipient please contact
the sender and delete all copies.
The contents of this message that do not relate to the official business of
our company shall be understood as neither given nor endorsed by it."

=================================




Archive powered by MHonArc 2.6.24.

Top of Page