[freetds] [ freetds-Patches-731907 ]Choosingdatalengthwhenbindingfixed types

Arnar Birgisson arnarb at oddi.is
Mon May 5 09:04:42 EDT 2003


Hello..

> 0000  03 01 02 4b 00 00 01 00  16 00 73 00 70 00 5f 00 |...K....
s.p._.|
> 
> Why character dump do not print some characters ? Wrong 
> isprint implementation ? What's your platform ?

I don't quite understand the first question. The platform is Linux
2.4.18 with GNU libc 2.2.5.
The manpage for isprint and co. says:

CONFORMING TO
       ANSI  - C, BSD 4.3.  isascii() is a BSD extension and is also an
SVID extension.  isblank() is a GNU extension.

I tried running this:
#include <stdio.h>
#include <ctype.h>

int main(void) {
  unsigned char c;
  for (c = 0; c < 255; c++)
    printf("0x%2x -> %d\n", c, isprint(c));
  printf("0x%x -> %d\n", 255, isprint(255));
}

and it revealed that isprint gave nonzero only for the characters in the
range 0x20-0x7e (inclusive) and zero for all others, according to that,
the line from the log is correct.
 
> 0010  73 00 61 00 76 00 65 00  5f 00 70 00 65 00 72 00   |s.a.v.e.
_.p.e.r.|
> 0020  73 00 69 00 73 00 74 00  65 00 6e 00 74 00 64 00   |s.i.s.t.
e.n.t.d.|
> 0030  61 00 74 00 61 00 00 00  05 40 00 64 00 61 00 74   |a.t.a...
@.d.a.t|
> 0040  00 61 00 00 27 04 04 59  54 6f 78 4f 6e 74 7a 4f   |.a..'..Y
ToxOntzO|
> 
> 27 04 04... FreeTDS it's trying to use old varchar (limited 
> to 255), this is the problem...

Can it be fixed? I you point me in the right direction I might be able
to figure it out.

Arnar




More information about the FreeTDS mailing list