Discussion:
[freetds] FreeTDS and out of Memor Error when trying to read diacritics
Sarr, Nathan
2012-04-26 14:14:56 UTC
Permalink
Hello,



I was wondering if someone might be able to help me. We are using
SUSE 11 SP1 64 bit, SQL Server 2008 R2, unixODBC 2.2.12 driver and
FreeTDS 0.91 and PHP 5.3.8. When retrieving a row with diacritics we
get a php out of memory error where it is trying to read all of the
memory in the system. Looking at the logs for FreeTDS we are getting
the following error:



util.c:104:logic error: cannot change query state from IDLE to PENDING



If we skip reading any fields with diacritics the data is read without
any issue. I've searched around and could not find any information about
this. We do have the text size set in the config file but this does not
seem to resolve the issue.



Any help would be greatly appreciated.



Thanks,

-Nate



Nathan Sarr

Senior Software Engineer

River Campus Libraries

University of Rochester

Rochester, NY 14627

(585) 275-0692

nsarr at library.rochester.edu <mailto:nsarr at library.rochester.edu>
James K. Lowden
2012-04-27 14:22:11 UTC
Permalink
On Thu, 26 Apr 2012 10:14:56 -0400
Post by Sarr, Nathan
I was wondering if someone might be able to help me. We are using
SUSE 11 SP1 64 bit, SQL Server 2008 R2, unixODBC 2.2.12 driver and
FreeTDS 0.91 and PHP 5.3.8. When retrieving a row with diacritics we
get a php out of memory error where it is trying to read all of the
memory in the system.
You want to make sure FreeTDS is encoding the data according to the
client's expectation. The data have an encoding (sometimes incorrectly
recorded) on the server. The client has one too, usually expressed
with LC_LANG etc. FreeTDS converts between the two.

To know what client encoding to use, FreeTDS looks by default to the
environment. That can be overridden by the "client charset" entry in
freetds.conf.
Post by Sarr, Nathan
Looking at the logs for FreeTDS we are getting
util.c:104:logic error: cannot change query state from IDLE to PENDING
I'm starting to rue the day I added that to the log. It's not
indicative of a user-observable problem. It's a reminder to take care
of some tedious housekeeping internal to the system.

Look at the top of your log to make sure FreeTDS is using the character
sets it should be. If it is, you might want to post the whole log
here. Make the session as short as possible to illustrate the issue
clearly.

HTH.

--jkl
Sarr, Nathan
2012-05-25 17:16:42 UTC
Permalink
Hi James,

Thanks for the help.

I wanted to follow up and let you know I found how to solve the problem. Since the field was an NVARCHAR I had to use a cast to Text in the select which fixed the issue.

-Nate

Nathan Sarr
Senior Software Engineer
River Campus Libraries
University of Rochester
Rochester, NY? 14627
(585) 275-0692
nsarr at library.rochester.edu


-----Original Message-----
From: freetds-bounces at lists.ibiblio.org [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of James K. Lowden
Sent: Friday, April 27, 2012 10:22 AM
To: freetds at lists.ibiblio.org
Subject: Re: [freetds] FreeTDS and out of Memor Error when trying to read diacritics

On Thu, 26 Apr 2012 10:14:56 -0400
Post by Sarr, Nathan
I was wondering if someone might be able to help me. We are using
SUSE 11 SP1 64 bit, SQL Server 2008 R2, unixODBC 2.2.12 driver and
FreeTDS 0.91 and PHP 5.3.8. When retrieving a row with diacritics we
get a php out of memory error where it is trying to read all of the
memory in the system.
You want to make sure FreeTDS is encoding the data according to the client's expectation. The data have an encoding (sometimes incorrectly
recorded) on the server. The client has one too, usually expressed with LC_LANG etc. FreeTDS converts between the two.

To know what client encoding to use, FreeTDS looks by default to the environment. That can be overridden by the "client charset" entry in freetds.conf.
Post by Sarr, Nathan
util.c:104:logic error: cannot change query state from IDLE to PENDING
I'm starting to rue the day I added that to the log. It's not indicative of a user-observable problem. It's a reminder to take care of some tedious housekeeping internal to the system.

Look at the top of your log to make sure FreeTDS is using the character sets it should be. If it is, you might want to post the whole log
here. Make the session as short as possible to illustrate the issue
clearly.

HTH.

--jkl

Loading...