Skip to Content.
Sympa Menu

freetds - Re: Crash in tsql (fixed, but still has problems!)

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: ZIGLIO Frediano <Frediano.Ziglio AT vodafoneomnitel.it>
  • To: "'TDS Development Group'" <freetds AT franklin.metalab.unc.edu>
  • Subject: Re: Crash in tsql (fixed, but still has problems!)
  • Date: Mon, 12 Aug 2002 16:34:36 +0200


For bit replace this code (in convert.c)

static TDS_INT
tds_convert_bit(int srctype,TDS_CHAR *src,
int desttype,TDS_INT destlen, CONV_RESULT *cr)
{
switch(desttype) {
case SYBCHAR:
case SYBVARCHAR:
cr->c = malloc(1);
*(cr->c) = src[0] ? '1' : '0';
break;

with

static TDS_INT
tds_convert_bit(int srctype,TDS_CHAR *src,
int desttype,TDS_INT destlen, CONV_RESULT *cr)
{
switch(desttype) {
case SYBCHAR:
case SYBVARCHAR:
cr->c = malloc(2);
cr->c[0] = src[0] ? '1' : '0';
cr->c[1] = 0;
return 1;
break;

this function do not return length...

For uuid... I'll do some quick test.

Linux on x86 ??

freddy77

>
> Brian,
>
> That quick-fix made a huge improvement, output from tsql is
> looking much
> closer to that from Query Analyzer. The text field now looks
> correct. The
> differences I see are:
>
> bit - should return 1, instead we get 1@@J or similar (1 and
> 3 garbage
> characters)
> image and varbinary - Same data, but M$ prepends 0x to the
> returned string

This is simple to fix... but we must be compatible with sybase ctlib and
dblib...

> unique_identifier - doesn't look much like the M$ version
>
> The results returned from sqsh look very similar to those
> from tsql before
> your fix. Bit is the same, 1@@J. Image returns a whole screen full of
> garbage.
> Text returns similar looking garbage to that tsql used to.
>
> I've only tested on Linux, not Tru64 yet. But as its well
> after midnight and
> I've been staring at this screen since 7am, I'm going to have to leave
> testing
> for a bit now :)
>
> David
>

=================================
"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