[freetds] select bug...

Spyros Ioakim sioakim at atlas.ace-hellas.gr
Mon May 12 13:36:33 EDT 2003

First of all I see you have realised what the problem is.
It is exactly as you describe.

I looked at my log file and indeed wherever there is a greek character
it is represented by a greek character.
That is the greek letter "Pi" is not converted to english "P".
What I'm saying is that the greek letters are not converted in the log
in any way.

My locale is all english:

Let me know if I can help with anything more.

Best Regards,

-----Original Message-----
From: freetds-bounces at lists.ibiblio.org
[mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Lowden, James K
Sent: Monday, May 12, 2003 5:56 PM
To: 'FreeTDS Development Group'
Subject: RE: [freetds] select bug...

> From: Spyros Ioakim [mailto:sioakim at atlas.ace-hellas.gr]
> Sent: May 11, 2003 4:45 PM
> OK found the old post...
> I have compiled freetds with these options:
> ./configure --with-tdsver=7.0 --enable-msdblib --with-unixodbc
> --prefix=/usr/local/freetds/
> I recompiled freetds with the nightly build I just downloaded 
> but still no luck.

Let me make sure I understand what you're seeing.  Using the latest
your query should return two rows, but using FreeTDS you get only one.
suspect an encoding problem, because your query includes a LIKE clause
against some literal Greek characters.  

The query is complex, but it's apparent that the Greek character
is part of a large OR condition.  Using the latest snapshot, you get
CompID 186.  Can you tell which criteria that meets, and how it's
from the one that was excluded?  Is in fact "CntrctType LIKE 'pS%'" the
salient clause?  ['pS%' isn't right; that's how my mailer represented
Greek letters.]

What's interesting, for some value of "interesting" is this chunk of
log file (from the snapshot):

23:59:04.187889 tds_put_string converting 36 bytes of "Ó%' AND ToDate >=
'05/06/03') ) ) )
23:59:04.187906 tds_put_string wrote 72 bytes
Sending packet @ 23:59:04.187922
0000 01 01 00 60 00 00 01 00-20 00 4c 00 49 00 4b 00 |...`....  .L.I.K.|
0010 45 00 20 00 27 00 f0 00-d3 00 25 00 27 00 20 00 |E. .'.ð. Ó.%.'. .|
0020 41 00 4e 00 44 00 20 00-54 00 6f 00 44 00 61 00 |A.N.D. . T.o.D.a.|
0030 74 00 65 00 20 00 3e 00-3d 00 20 00 27 00 30 00 |t.e. .>. =. .'.0.|
0040 35 00 2f 00 30 00 36 00-2f 00 30 00 33 00 27 00 |5./.0.6. /.0.3.'.|
0050 29 00 20 00 29 00 20 00-29 00 20 00 29 00 0a 00 |). .). . ). .)...|

What I want to know, Spyro, is this:  Are the characters in line 0010
correct?  That is, are the Greek characters you're comparing to encoded
=00f0 and =00d3 in UCS-2?  Because that's what we're asking the server

I'm betting those are the wrong values.  Why?  

1.  You got the wrong answer.
2.  The log says we're converting from ISO-8859-1.  

I'm betting that if you look at the UCS-2 =00f0 character, find its
ISO-8859-1 equivalent, take that binary value, and look it up in the
charset your client is actually using (whew!) *that* is the character
meant to send. 

Tell me if we're on the right track, and then we can go on from there.
Also, could I see the output of locale(1) on the system in question?  

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

FreeTDS mailing list
FreeTDS at lists.ibiblio.org

More information about the FreeTDS mailing list